Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1377 → Rev 1378

/alcasar.sh
27,7 → 27,7
# -u or --uninstall
 
# Functions :
# testing : connectivity tests and downloading before intall
# testing : connectivity tests, free space test and mageia version test
# init : Installation of RPM and scripts
# network : Network parameters
# ACC : ALCASAR Control Center installation
103,6 → 103,7
 
##################################################################
## Function "testing" ##
## - Test of Mageia version ##
## - Test of free space on /var (>10G) ##
## - Test of Internet access ##
##################################################################
137,6 → 138,7
else
if [ ! -d /var/log/netflow/porttracker ]
then
# Test of free space on /var
free_space=`df -BG --output=avail /var|tail -1|tr -d [:space:]G`
if [ $free_space -lt 10 ]
then
146,9 → 148,61
fi
exit 0
fi
fi
fi
# Test of Mageia version
# extract the current Mageia version and hardware architecture (i586 ou X64)
fic=`cat /etc/product.id`
unknown_os=0
old="$IFS"
IFS=","
set $fic
for i in $*
do
if [ "`echo $i|grep distribution|cut -d'=' -f1`" == "distribution" ]
then
DISTRIBUTION=`echo $i|cut -d"=" -f2`
unknown_os=`expr $unknown_os + 1`
fi
if [ "`echo $i|grep version|cut -d'=' -f1`" == "version" ]
then
CURRENT_VERSION=`echo $i|cut -d"=" -f2`
unknown_os=`expr $unknown_os + 1`
fi
if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ]
then
ARCH=`echo $i|cut -d"=" -f2`
unknown_os=`expr $unknown_os + 1`
fi
done
IFS="$old"
if [[ ( $unknown_os != 3 || "$DISTRIBUTION" != "Mageia" ) && ( "$CURRENT_VERSION" != "4" ) ]]
then
if [ $Lang == "fr" ]
then
echo "L'installation ou la mise @ jour d'ALCASAR ne peut pas être réalisée."
echo "Le système d'exploitation doit être remplacé (Mageia4)"
else
echo "The automatic update of ALCASAR can't be performed."
echo "The OS must be replaced (Mageia4)"
fi
if [ -e /tmp/alcasar-conf.tar.gz ]
then
echo
if [ $Lang == "fr" ]
then
echo "1 - Récupérez le fichier de configuration actuel (/tmp/alcasar-conf.tar.gz)."
echo "2 - Installez Linux-Mageia4 (cf. doc d'installation)"
echo "3 - copiez le fichier 'alcasar-conf.tar.gz' dans le répertoire '/tmp' avant de lancer l'installation d'ALCASAR"
else
echo "1 - Retrieve the configuration file (/tmp/alcasar-conf.tar.gz)"
echo "2 - Install Linux-Mageia4 (cf. installation doc)"
echo "3 - Copy the file 'alcasar-conf.tar.gz' in the folder '/tmp' before launching the installation of ALCASAR"
fi
fi
exit 0
fi
fi
if [ $Lang == "fr" ]
if [ $Lang == "fr" ]
then echo -n "Tests des paramètres réseau : "
else echo -n "Network parameters tests : "
fi
699,6 → 753,8
ErrorDocument 404 https://$HOSTNAME.$DOMAIN/
</Directory>
EOF
# Launch after coova
$SED "s?^After=.*?After=network.target remote-fs.target nss-lookup.target chilli.service?g" /lib/systemd/system/httpd.service
} # End of ACC()
 
##########################################################################################
893,7 → 949,7
After=network.target
 
[Service]
Type=forking
Type=oneshot
ExecStart=/usr/libexec/chilli start
ExecStop=/usr/libexec/chilli stop
ExecReload=/usr/libexec/chilli reload
1668,18 → 1724,18
$SED "/^kernel/s/BOOT_IMAGE=linux /BOOT_IMAGE=linux-nonfb /" /boot/grub/menu.lst
$SED "/^gfxmenu/d" /boot/grub/menu.lst
# Remove unused services and users
for svc in sshd.service alsa-state
for svc in sshd.service
do
/bin/systemctl -q disable $svc
done
for rm_users in games
do
user=`cat /etc/passwd|grep $rm_users|cut -d":" -f1`
if [ "$user" == "$rm_users" ]
then
/usr/sbin/userdel -f $rm_users
fi
done
# for rm_users in games
# do
# user=`cat /etc/passwd|grep $rm_users|cut -d":" -f1`
# if [ "$user" == "$rm_users" ]
# then
# /usr/sbin/userdel -r $rm_users
# fi
# done
# Load and apply the previous conf file
if [ "$mode" = "update" ]
then