Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2395 → Rev 2396

/alcasar.sh
162,7 → 162,7
# Test if ALCASAR is already installed
if [ -e $CONF_FILE ]
then
current_version=`cat $CONF_FILE | grep VERSION | cut -d"=" -f2`
current_version=`grep ^VERSION= $CONF_FILE | cut -d"=" -f2`
if [ $Lang == "fr" ]
then echo -n "La version "; echo -n $current_version ; echo " d'ALCASAR est déjà installée";
else echo -n "ALCASAR Version "; echo -n $current_version ; echo " is already installed";
472,7 → 472,7
PRIVATE_IP_MASK=$DEFAULT_PRIVATE_IP_MASK
fi
else
PRIVATE_IP_MASK=`grep PRIVATE_IP conf/etc/alcasar.conf|cut -d"=" -f2`
PRIVATE_IP_MASK=`grep ^PRIVATE_IP= conf/etc/alcasar.conf|cut -d"=" -f2`
rm -rf conf/etc/alcasar.conf
fi
# Define LAN side global parameters
499,7 → 499,7
PRIVATE_MAC=`/usr/sbin/ip link show $INTIF | grep ether | cut -d" " -f6| sed 's/:/-/g'| awk '{print toupper($0)}'` # MAC address of INTIF
# Define Internet parameters
DNS1=`grep ^nameserver /etc/resolv.conf|awk -F" " '{print $2}'|head -n 1` # 1st DNS server
nb_dns=`grep ^nameserver /etc/resolv.conf|wc -l`
nb_dns=`grep -c ^nameserver /etc/resolv.conf`
if [ $nb_dns == 2 ]
then
DNS2=`grep ^nameserver /etc/resolv.conf|cut -d" " -f2|tail -n 1` # 2nd DNS server (if exist)
1308,7 → 1308,7
# Configuration des fichier WEB d'interception (secret partagé avec coova-chilli)
$SED "s?^\$uamsecret =.*?\$uamsecret = \"$secretuam\";?g" $DIR_WEB/intercept.php
# user 'chilli' creation (in order to run conup/off and up/down scripts
chilli_exist=`grep chilli /etc/passwd|wc -l`
chilli_exist=`grep -c ^chilli: /etc/passwd`
if [ "$chilli_exist" == "1" ]
then
userdel -r chilli 2>/dev/null
1385,7 → 1385,7
antivirus ()
{
# create 'havp' user
havp_exist=`grep havp /etc/passwd|wc -l`
havp_exist=`grep -c ^havp: /etc/passwd`
if [ "$havp_exist" == "1" ]
then
userdel -r havp 2>/dev/null
1438,7 → 1438,7
##########################################################################
tinyproxy ()
{
tinyproxy_exist=`grep tinyproxy /etc/passwd|wc -l`
tinyproxy_exist=`grep -c ^tinyproxy: /etc/passwd`
if [ "$tinyproxy_exist" == "1" ]
then
userdel -r tinyproxy 2>/dev/null
2164,8 → 2164,8
ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
# GRUB modifications (only one time)
# Limit wait time to 3s - Create an alcasar entry instead of linux-nonfb - Change the default banner
vm_vga=`lsmod | egrep "virtio|vmwgfx" | wc -l` # test if in VM
grub_already_modified=`grep ALCASAR /boot/grub/menu.lst|wc -l`
vm_vga=`lsmod | egrep -c "virtio|vmwgfx"` # test if in VM
grub_already_modified=`grep -c ALCASAR /boot/grub/menu.lst`
[ -e /etc/mageia-release.default ] || cp /etc/mageia-release /etc/mageia-release.default
if [ $grub_already_modified == 0 ]
then
2222,7 → 2222,7
echo
echo " Appuyez sur 'Entrée' pour continuer"
else
echo "# Enf of ALCASAR install process #"
echo "# End of ALCASAR install process #"
echo "# #"
echo "# Application Libre pour le Contrôle Authentifié et Sécurisé #"
echo "# des Accès au Réseau ( ALCASAR ) #"
2324,8 → 2324,8
fi
# Extract the central configuration file
tar -xf /tmp/alcasar-conf* conf/etc/alcasar.conf
ORGANISME=`grep ORGANISM conf/etc/alcasar.conf|cut -d"=" -f2`
PREVIOUS_VERSION=`grep VERSION conf/etc/alcasar.conf|cut -d"=" -f2`
ORGANISME=`grep ^ORGANISM= conf/etc/alcasar.conf|cut -d"=" -f2`
PREVIOUS_VERSION=`grep ^VERSION= conf/etc/alcasar.conf|cut -d"=" -f2`
MAJ_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f1`
MIN_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f2|cut -c1`
UPD_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f3`