Subversion Repositories ALCASAR

Rev

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

Rev 306 Rev 307
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
#  $Id: alcasar.sh 306 2010-10-13 22:08:04Z richard $ 
2
#  $Id: alcasar.sh 307 2010-10-22 21:44:53Z richard $ 
3
 
3
 
4
# alcasar.sh
4
# alcasar.sh
5
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
5
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
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
 
7
 
Line 205... Line 205...
205
	done
205
	done
206
	for svc in alsa sound dm atd dc_server
206
	for svc in alsa sound dm atd dc_server
207
	do
207
	do
208
		/sbin/chkconfig --del $svc
208
		/sbin/chkconfig --del $svc
209
	done
209
	done
210
	for rm_users in avahi avahi-autoipd icapd
210
	for rm_users in avahi-autoipd avahi icapd
211
	do
211
	do
212
		user=`cat /etc/passwd|grep $rm_users`
212
		user=`cat /etc/passwd|grep $rm_users|cut -d":" -f1`
213
		if [ "$user" == "$rm_users" ]
213
		if [ "$user" == "$rm_users" ]
214
		then
214
		then
215
			/usr/sbin/userdel -f $rm_users
215
			/usr/sbin/userdel -f $rm_users
216
		fi
216
		fi
217
	done
217
	done
Line 871... Line 871...
871
	[ -e /etc/init.d/dansguardian.default ] || cp /etc/init.d/dansguardian /etc/init.d/dansguardian.default
871
	[ -e /etc/init.d/dansguardian.default ] || cp /etc/init.d/dansguardian /etc/init.d/dansguardian.default
872
	cp -f $DIR_CONF/dansguardian-init /etc/init.d/dansguardian
872
	cp -f $DIR_CONF/dansguardian-init /etc/init.d/dansguardian
873
	mkdir /var/dansguardian
873
	mkdir /var/dansguardian
874
	chown dansguardian /var/dansguardian
874
	chown dansguardian /var/dansguardian
875
	[ -e /etc/dansguardian/dansguardian.conf.default ] || cp /etc/dansguardian/dansguardian.conf /etc/dansguardian/dansguardian.conf.default
875
	[ -e /etc/dansguardian/dansguardian.conf.default ] || cp /etc/dansguardian/dansguardian.conf /etc/dansguardian/dansguardian.conf.default
876
# par défaut, le filtrage WEB est désactivé
876
# Le filtrage est désactivé par défaut 
877
	$SED "s/^reportinglevel =.*/reportinglevel = -1/g" /etc/dansguardian/dansguardian.conf
877
	$SED "s/^reportinglevel =.*/reportinglevel = -1/g" /etc/dansguardian/dansguardian.conf
878
# la page d'interception est en français
878
# la page d'interception est en français
879
	$SED "s?^language =.*?language = french?g" /etc/dansguardian/dansguardian.conf
879
	$SED "s?^language =.*?language = french?g" /etc/dansguardian/dansguardian.conf
880
# on limite l'écoute de Dansguardian côté LAN
880
# on limite l'écoute de Dansguardian côté LAN
881
	$SED "s?^filterip =.*?filterip = $PRIVATE_IP?g" /etc/dansguardian/dansguardian.conf
881
	$SED "s?^filterip =.*?filterip = $PRIVATE_IP?g" /etc/dansguardian/dansguardian.conf
Line 939... Line 939...
939
##################################################################
939
##################################################################
940
antivirus ()		
940
antivirus ()		
941
{
941
{
942
# création de l'usager 'havp'
942
# création de l'usager 'havp'
943
	havp_exist=`grep havp /etc/passwd|wc -l`
943
	havp_exist=`grep havp /etc/passwd|wc -l`
944
	if [ "$havp_exist" == "0" ]
944
	if [ "$havp_exist" == "1" ]
945
	then
945
	then
946
	      useradd havp
946
	      userdel -r havp
947
	fi
947
	fi
-
 
948
	groupadd -f havp
-
 
949
	useradd -g havp havp
948
# création de la partition de stockage temporaire (100Mo)
950
# création de la partition de stockage temporaire (100Mo)
949
	dd if=/dev/zero of=/tmp/havp-disk bs=1024k count=30
951
	dd if=/dev/zero of=/tmp/havp-disk bs=1024k count=30
950
	mkfs.ext4 -qF /tmp/havp-disk
952
	mkfs.ext4 -qF /tmp/havp-disk
951
	mkdir -p /var/tmp/havp /var/log/havp
-
 
952
	echo "# Entry for havp tmp files scan partition" >> /etc/fstab
953
	echo "# Entry for havp tmp files scan partition" >> /etc/fstab
953
	echo "/tmp/havp-disk /var/tmp/havp ext4 loop,mand,noatime,async" >> /etc/fstab
954
	echo "/tmp/havp-disk /var/tmp/havp ext4 loop,mand,noatime,async" >> /etc/fstab
-
 
955
	$SED "/$HAVP_BIN -c $HAVP_CONFIG/i chown -R havp:havp \/var\/tmp\/havp" /etc/init.d/havp
954
	mount /var/tmp/havp
956
	mkdir -p /var/tmp/havp /var/log/havp
955
	chown -R havp /var/tmp/havp /var/log/havp /var/run/havp
957
	chown -R havp /var/log/havp /var/run/havp
956
# configuration d'HAVP
958
# configuration d'HAVP
957
	[ -e /etc/havp/havp.config.default ] || cp /etc/havp/havp.config /etc/havp/havp.config.default
959
	[ -e /etc/havp/havp.config.default ] || cp /etc/havp/havp.config /etc/havp/havp.config.default
958
	$SED "/^REMOVETHISLINE/d" /etc/havp/havp.config
960
	$SED "/^REMOVETHISLINE/d" /etc/havp/havp.config
959
	$SED "s?^# PARENTPROXY.*?PARENTPROXY 127.0.0.1?g" /etc/havp/havp.config
961
	$SED "s?^# PARENTPROXY.*?PARENTPROXY 127.0.0.1?g" /etc/havp/havp.config
960
	$SED "s?^# PARENTPORT.*?PARENTPORT 3128?g" /etc/havp/havp.config
962
	$SED "s?^# PARENTPORT.*?PARENTPORT 3128?g" /etc/havp/havp.config
Line 1330... Line 1332...
1330
		fi
1332
		fi
1331
		for func in init network gestion AC init_db param_radius param_web_radius param_chilli param_squid param_dansguardian antivirus firewall param_awstats param_dnsmasq cron post_install
1333
		for func in init network gestion AC init_db param_radius param_web_radius param_chilli param_squid param_dansguardian antivirus firewall param_awstats param_dnsmasq cron post_install
1332
 
1334
 
1333
		do
1335
		do
1334
			$func
1336
			$func
1335
 #echo "*** 'debug' : end of function $func ***"; read a
1337
 echo "*** 'debug' : end of function $func ***"; read a
1336
		done
1338
		done
1337
		;;
1339
		;;
1338
	-u | --uninstall)
1340
	-u | --uninstall)
1339
		if [ ! -e $DIR_DEST_SBIN/alcasar-uninstall.sh ]
1341
		if [ ! -e $DIR_DEST_SBIN/alcasar-uninstall.sh ]
1340
		then
1342
		then