Subversion Repositories ALCASAR

Rev

Rev 2397 | Rev 2409 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2397 Rev 2399
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 2397 2017-08-27 13:38:32Z tom.houdayer $ 
2
#  $Id: alcasar.sh 2399 2017-08-27 14:06:54Z tom.houdayer $ 
3
 
3
 
4
# alcasar.sh
4
# alcasar.sh
5
 
5
 
6
# ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
6
# ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
7
# Ce programme est un logiciel libre ; This software is free and open source
7
# Ce programme est un logiciel libre ; This software is free and open source
Line 383... Line 383...
383
			fi
383
			fi
384
		done
384
		done
385
	fi
385
	fi
386
# On crée aléatoirement les mots de passe et les secrets partagés
386
# On crée aléatoirement les mots de passe et les secrets partagés
387
	rm -f $PASSWD_FILE
387
	rm -f $PASSWD_FILE
388
	grubpwd=`cat /dev/urandom | tr -dc [:alnum:] | head -c8`
388
	grubpwd=`cat /dev/urandom | tr -dc [:alnum:] | head -c16`
389
	echo -n "Password to protect the GRUB boot menu (!!!qwerty keyboard) : " > $PASSWD_FILE
389
	echo -n "Password to protect the GRUB boot menu (!!!qwerty keyboard) : " > $PASSWD_FILE
390
	echo "$grubpwd" >> $PASSWD_FILE
390
	echo "$grubpwd" >> $PASSWD_FILE
391
	md5_grubpwd=`/usr/bin/openssl passwd -1 $grubpwd`
391
	md5_grubpwd=`/usr/bin/openssl passwd -1 $grubpwd`
392
	$SED "/^password.*/d" /boot/grub/menu.lst
392
	$SED "/^password.*/d" /boot/grub/menu.lst
393
	$SED "1ipassword --md5 $md5_grubpwd" /boot/grub/menu.lst
393
	$SED "1ipassword --md5 $md5_grubpwd" /boot/grub/menu.lst
394
	mysqlpwd=`cat /dev/urandom | tr -dc [:alnum:] | head -c8`
394
	mysqlpwd=`cat /dev/urandom | tr -dc [:alnum:] | head -c16`
395
	echo -n "Name and password of Mysql/mariadb administrator : " >> $PASSWD_FILE
395
	echo -n "Name and password of Mysql/mariadb administrator : " >> $PASSWD_FILE
396
	echo "root / $mysqlpwd" >> $PASSWD_FILE
396
	echo "root / $mysqlpwd" >> $PASSWD_FILE
397
	radiuspwd=`cat /dev/urandom | tr -dc [:alnum:] | head -c8`
397
	radiuspwd=`cat /dev/urandom | tr -dc [:alnum:] | head -c16`
398
	echo -n "Name and password of Mysql/mariadb user : " >> $PASSWD_FILE
398
	echo -n "Name and password of Mysql/mariadb user : " >> $PASSWD_FILE
399
	echo "$DB_USER / $radiuspwd" >> $PASSWD_FILE
399
	echo "$DB_USER / $radiuspwd" >> $PASSWD_FILE
400
	secretuam=`cat /dev/urandom | tr -dc [:alnum:] | head -c8`
400
	secretuam=`cat /dev/urandom | tr -dc [:alnum:] | head -c16`
401
	echo -n "Shared secret between the script 'intercept.php' and coova-chilli : " >> $PASSWD_FILE
401
	echo -n "Shared secret between the script 'intercept.php' and coova-chilli : " >> $PASSWD_FILE
402
	echo "$secretuam" >> $PASSWD_FILE
402
	echo "$secretuam" >> $PASSWD_FILE
403
	secretradius=`cat /dev/urandom | tr -dc [:alnum:] | head -c8`
403
	secretradius=`cat /dev/urandom | tr -dc [:alnum:] | head -c16`
404
	echo -n "Shared secret between coova-chilli and FreeRadius : " >> $PASSWD_FILE
404
	echo -n "Shared secret between coova-chilli and FreeRadius : " >> $PASSWD_FILE
405
	echo "$secretradius" >> $PASSWD_FILE
405
	echo "$secretradius" >> $PASSWD_FILE
406
	chmod 640 $PASSWD_FILE
406
	chmod 640 $PASSWD_FILE
407
#  copy scripts in in /usr/local/bin
407
#  copy scripts in in /usr/local/bin
408
	cp -f $DIR_SCRIPTS/alcasar* $DIR_DEST_BIN/. ; chown root:root $DIR_DEST_BIN/alcasar* ; chmod 740 $DIR_DEST_BIN/alcasar*
408
	cp -f $DIR_SCRIPTS/alcasar* $DIR_DEST_BIN/. ; chown root:root $DIR_DEST_BIN/alcasar* ; chmod 740 $DIR_DEST_BIN/alcasar*