[ Index ] |
PHP Cross Reference of Unnamed Project |
[Summary view] [Print] [Text view]
1 #!/bin/bash 2 3 # $Id: set_password_menu_tftp.sh 5927 2010-11-08 21:44:48Z crob $ 4 # Auteur: Stephane Boireau 5 # Dernière modification: 02/11/2010 6 7 # Ajout en visudo: 8 # Cmnd_Alias SE3CLONAGE=/usr/share/se3/scripts/se3_pxe_slitaz_cmdline.sh,/usr/share/se3/scripts/set_password_menu_tftp.sh,/usr/share/se3/scripts/se3_pxe_menu_ou_pas.sh,/usr/share/se3/scripts/se3_tftp_boot_pxe.sh,/usr/share/se3/scripts/pxe_gen_cfg.sh,/usr/share/se3/scripts/recup_rapport.php,/usr/share/se3/scripts/se3_tftp_menage_atq.sh 9 10 if [ -e /var/www/se3/includes/config.inc.php ]; then 11 dbhost=`cat /var/www/se3/includes/config.inc.php | grep "dbhost=" | cut -d = -f 2 |cut -d \" -f 2` 12 dbname=`cat /var/www/se3/includes/config.inc.php | grep "dbname=" | cut -d = -f 2 |cut -d \" -f 2` 13 dbuser=`cat /var/www/se3/includes/config.inc.php | grep "dbuser=" | cut -d = -f 2 |cut -d \" -f 2` 14 dbpass=`cat /var/www/se3/includes/config.inc.php | grep "dbpass=" | cut -d = -f 2 |cut -d \" -f 2` 15 else 16 echo "Fichier de conf inaccessible" 17 exit 1 18 fi 19 20 tftp_delais_boot_pxe=$(echo "SELECT value FROM params WHERE name='tftp_delais_boot_pxe';"|mysql -N -h $dbhost -u $dbuser -p$dbpass $dbname) 21 if [ -z "$tftp_delais_boot_pxe" ]; then 22 tftp_delais_boot_pxe=8 23 else 24 # Normalement, on a du enregistrer une valeur entiere, mais bon... 25 t=$(echo "$tftp_delais_boot_pxe" | sed -e "s|[0-9]||g") 26 if [ -n "$t" ]; then 27 tftp_delais_boot_pxe=8 28 fi 29 fi 30 31 /usr/share/se3/scripts/se3_pxe_menu_ou_pas.sh 'menu' $tftp_delais_boot_pxe 32 33 # Dependance pour sha1pass 34 # apt-get -y install libdigest-sha1-perl 35 36 if [ -n "$1" ]; then 37 pass_en_clair="$1" 38 pass_sha1=$(/usr/share/se3/scripts/sha1pass "$pass_en_clair}") 39 40 sed -i "s|^# MENU PASSWD ###TFTP_PASSWORD_MENU_PXE###| MENU PASSWD $pass_sha1}|" /tftpboot/pxelinux.cfg/default 41 fi
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Tue Mar 17 22:47:18 2015 | Cross-referenced by PHPXref 0.7.1 |