Subversion Repositories ALCASAR

Rev

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

Rev 2375 Rev 2376
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 2375 2017-08-16 18:30:43Z tom.houdayer $ 
2
#  $Id: alcasar.sh 2376 2017-08-16 18:46:50Z 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 1175... Line 1175...
1175
pidfile=/var/run/chilli.pid
1175
pidfile=/var/run/chilli.pid
1176
[ -f \$CONFIG ] || {
1176
[ -f \$CONFIG ] || {
1177
    echo "\$CONFIG Not found"
1177
    echo "\$CONFIG Not found"
1178
    exit 0
1178
    exit 0
1179
}
1179
}
-
 
1180
current_users_file="/var/tmp/havp/current_users.txt"	# file containing active users
1180
RETVAL=0
1181
RETVAL=0
1181
prog="chilli"
1182
prog="chilli"
1182
case \$1 in
1183
case \$1 in
1183
    start)
1184
    start)
1184
	if [ -f \$pidfile ] ; then 
1185
	if [ -f \$pidfile ] ; then 
1185
		gprintf "chilli is already running"
1186
		gprintf "chilli is already running"
1186
	else
1187
	else
1187
        	gprintf "Starting \$prog: "
1188
        	gprintf "Starting \$prog: "
-
 
1189
		[ -e \$current_users_file ] && echo '' > \$current_users_file
1188
		rm -f /var/run/chilli* # cleaning
1190
		rm -f /var/run/chilli* # cleaning
1189
        	/usr/sbin/modprobe tun >/dev/null 2>&1
1191
        	/usr/sbin/modprobe tun >/dev/null 2>&1
1190
        	echo 1 > /proc/sys/net/ipv4/ip_forward
1192
        	echo 1 > /proc/sys/net/ipv4/ip_forward
1191
		[ -e /dev/net/tun ] || {
1193
		[ -e /dev/net/tun ] || {
1192
	    	(cd /dev; 
1194
	    	(cd /dev; 
Line 1220... Line 1222...
1220
	if [ -f \$pidfile ] ; then  
1222
	if [ -f \$pidfile ] ; then  
1221
        	gprintf "Shutting down \$prog: "
1223
        	gprintf "Shutting down \$prog: "
1222
		killproc /usr/sbin/chilli
1224
		killproc /usr/sbin/chilli
1223
		RETVAL=\$?
1225
		RETVAL=\$?
1224
		[ \$RETVAL = 0 ] && rm -f \$pidfile
1226
		[ \$RETVAL = 0 ] && rm -f \$pidfile
-
 
1227
		[ -e \$current_users_file ] && rm -f \$current_users_file
1225
	else	
1228
	else	
1226
        	gprintf "chilli is not running"
1229
        	gprintf "chilli is not running"
1227
	fi
1230
	fi
1228
	;;
1231
	;;
1229
    
1232