Subversion Repositories ALCASAR

Rev

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

Rev 2847 Rev 2850
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 2847 2020-07-05 21:47:51Z rexy $
2
#  $Id: alcasar.sh 2850 2020-07-15 22:24:44Z 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 221... Line 221...
221
			mode="update"
221
			mode="update"
222
		fi
222
		fi
223
	fi
223
	fi
224
# Free /var (when updating) and test free space
224
# Free /var (when updating) and test free space
225
	[ -d /var/log/netflow ] && rm -rf /var/log/netflow  # remove old porttracker RRD database
225
	[ -d /var/log/netflow ] && rm -rf /var/log/netflow  # remove old porttracker RRD database
226
	[ -d /var/lib/clamav ] && rm -rf /var/lib/clamav # remove old clamav database
226
	[ -d /var/lib/clamav ] && rm -rf /var/lib/clamav/* # remove old clamav database
227
	journalctl -q --vacuum-files 1  # remove previous journal logs
227
	journalctl -q --vacuum-files 1  # remove previous journal logs
228
	free_space=`df -BG --output=avail /var|tail -1|tr -d '[:space:]G'`
228
	free_space=`df -BG --output=avail /var|tail -1|tr -d '[:space:]G'`
229
	if [ $free_space -lt 10 ]
229
	if [ $free_space -lt 10 ]
230
		then
230
		then
231
		if [ $Lang == "fr" ]
231
		if [ $Lang == "fr" ]
Line 2095... Line 2095...
2095
	[ -e /etc/bashrc.default ]  || cp /etc/bashrc /etc/bashrc.default
2095
	[ -e /etc/bashrc.default ]  || cp /etc/bashrc /etc/bashrc.default
2096
	cp -f $DIR_CONF/bashrc /etc/. ; chmod 644 /etc/bashrc ; chown root:root /etc/bashrc
2096
	cp -f $DIR_CONF/bashrc /etc/. ; chmod 644 /etc/bashrc ; chown root:root /etc/bashrc
2097
	$SED "s?^ORGANISME.*?ORGANISME=$ORGANISME?g" /etc/bashrc
2097
	$SED "s?^ORGANISME.*?ORGANISME=$ORGANISME?g" /etc/bashrc
2098
# sudoers configuration for "apache" & "sysadmin"
2098
# sudoers configuration for "apache" & "sysadmin"
2099
	[ -e /etc/sudoers.default ]  || cp /etc/sudoers /etc/sudoers.default
2099
	[ -e /etc/sudoers.default ]  || cp /etc/sudoers /etc/sudoers.default
2100
	cp -f $DIR_CONF/sudoers /etc/. ; chmod 440 /etc/sudoers ; chown root:root /etc/sudoers
2100
	cp -f $DIR_CONF/sudoers /etc/ ; chmod 440 /etc/sudoers ; chown root:root /etc/sudoers
2101
	$SED "s?^Host_Alias.*?Host_Alias	LAN_ORG=$PRIVATE_NETWORK/$PRIVATE_NETMASK,localhost		#réseau de l'organisme?g" /etc/sudoers
2101
	$SED "s?^Host_Alias.*?Host_Alias	LAN_ORG=$PRIVATE_NETWORK/$PRIVATE_NETMASK,localhost		#réseau de l'organisme?g" /etc/sudoers
2102
# Modify some logrotate files (gammu, ulogd)
2102
# Modify some logrotate files (gammu, ulogd)
2103
	cp -f $DIR_CONF/logrotate.d/* /etc/logrotate.d/
2103
	cp -f $DIR_CONF/logrotate.d/* /etc/logrotate.d/
2104
	chmod 644 /etc/logrotate.d/*
2104
	chmod 644 /etc/logrotate.d/*
2105
# Log compression
2105
# Log compression