Subversion Repositories ALCASAR

Rev

Rev 2736 | Rev 2739 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2736 Rev 2737
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 2736 2019-05-28 22:06:08Z rexy $
2
#  $Id: alcasar.sh 2737 2019-06-04 22:11:57Z rexy $
3
 
3
 
4
# alcasar.sh
4
# alcasar.sh
5
# ALCASAR is a Free and open source NAC created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
5
# ALCASAR is a Free and open source NAC created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
#  team@alcasar.net
7
#  team@alcasar.net
Line 487... Line 487...
487
##########################################
487
##########################################
488
 
488
 
489
INSTALL_DATE=$DATE
489
INSTALL_DATE=$DATE
490
VERSION=$VERSION
490
VERSION=$VERSION
491
ORGANISM=$ORGANISME
491
ORGANISM=$ORGANISME
492
HOSTNAME=$HOSTNAME
-
 
493
DOMAIN=$DOMAIN
-
 
494
EOF
492
EOF
495
        chmod o-rwx $CONF_FILE
493
        chmod o-rwx $CONF_FILE
496
} # End of init()
494
} # End of init()
497
 
495
 
498
#########################################################
496
#########################################################
Line 612... Line 610...
612
#       fi
610
#       fi
613
        PUBLIC_NETMASK=`/bin/ipcalc -m $PUBLIC_IP_MASK | cut -d"=" -f2`
611
        PUBLIC_NETMASK=`/bin/ipcalc -m $PUBLIC_IP_MASK | cut -d"=" -f2`
614
        PUBLIC_PREFIX=`/bin/ipcalc -p $PUBLIC_IP $PUBLIC_NETMASK|cut -d"=" -f2`
612
        PUBLIC_PREFIX=`/bin/ipcalc -p $PUBLIC_IP $PUBLIC_NETMASK|cut -d"=" -f2`
615
        PUBLIC_NETWORK=`/bin/ipcalc -n $PUBLIC_IP/$PUBLIC_PREFIX|cut -d"=" -f2`
613
        PUBLIC_NETWORK=`/bin/ipcalc -n $PUBLIC_IP/$PUBLIC_PREFIX|cut -d"=" -f2`
616
# Write network parameters in the conf file
614
# Write network parameters in the conf file
-
 
615
        echo "HOSTNAME=$HOSTNAME" >> $CONF_FILE
-
 
616
        echo "DOMAIN=$DOMAIN" >> $CONF_FILE
617
        echo "EXTIF=$EXTIF" >> $CONF_FILE
617
        echo "EXTIF=$EXTIF" >> $CONF_FILE
618
        echo "INTIF=$INTIF" >> $CONF_FILE
618
        echo "INTIF=$INTIF" >> $CONF_FILE
619
        ######## Récupération des interfaces du ou des réseaux de consultation supplémentaires #################
619
        ######## Récupération des interfaces du ou des réseaux de consultation supplémentaires #################
620
        INTERFACES=`/usr/sbin/ip link|grep '^[[:digit:]]:'|grep -v "^lo\|$EXTIF\|tun0"|cut -d " " -f2|tr -d ":"`
620
        INTERFACES=`/usr/sbin/ip link|grep '^[[:digit:]]:'|grep -v "^lo\|$EXTIF\|tun0"|cut -d " " -f2|tr -d ":"`
621
        for i in $INTERFACES
621
        for i in $INTERFACES
Line 889... Line 889...
889
                header_install
889
                header_install
890
# Creation of keys file for the admin account ("admin")
890
# Creation of keys file for the admin account ("admin")
891
                [ -d $DIR_DEST_ETC/digest ] && rm -rf $DIR_DEST_ETC/digest
891
                [ -d $DIR_DEST_ETC/digest ] && rm -rf $DIR_DEST_ETC/digest
892
                mkdir -p $DIR_DEST_ETC/digest
892
                mkdir -p $DIR_DEST_ETC/digest
893
                chmod 755 $DIR_DEST_ETC/digest
893
                chmod 755 $DIR_DEST_ETC/digest
-
 
894
                if [ $Lang == "fr" ]
-
 
895
                        then echo -n "Création du premier compte administrateur : "
-
 
896
                        else echo -n "Creation of the first admin account : "
-
 
897
                fi
894
                until [ -s $DIR_DEST_ETC/digest/key_admin ]
898
                until [ -s $DIR_DEST_ETC/digest/key_admin ]
895
                do
899
                do
896
                        $DIR_DEST_BIN/alcasar-profil.sh --add admin
900
                        $DIR_DEST_BIN/alcasar-profil.sh --add admin
897
                done
901
                done
898
        fi
902
        fi
899
 
903
 
900
        # Run after coova (in order to wait tun0 to be up)
904
        # Run lighttpd after coova (in order waiting tun0 to be up)
901
        $SED "s?^After=.*?After=network.target remote-fs.target nss-lookup.target chilli.service?g" /lib/systemd/system/lighttpd.service
905
        $SED "s?^After=.*?After=network.target remote-fs.target nss-lookup.target chilli.service?g" /lib/systemd/system/lighttpd.service
902
        # Log file for ACC access imputability
906
        # Log file for ACC access imputability
903
        [ -e /var/Save/security/acc_access.log ] || touch /var/Save/security/acc_access.log
907
        [ -e /var/Save/security/acc_access.log ] || touch /var/Save/security/acc_access.log
904
        chown root:apache /var/Save/security/acc_access.log
908
        chown root:apache /var/Save/security/acc_access.log
905
        chmod 664 /var/Save/security/acc_access.log
909
        chmod 664 /var/Save/security/acc_access.log