Subversion Repositories ALCASAR

Rev

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

Rev 2394 Rev 2454
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-watchdog.sh 2394 2017-08-27 13:28:59Z tom.houdayer $
2
# $Id: alcasar-watchdog.sh 2454 2017-12-09 18:59:31Z tom.houdayer $
3
 
3
 
4
# alcasar-watchdog.sh
4
# alcasar-watchdog.sh
5
# by Rexy
5
# by 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
# - Ce script prévient les usagers de l'indisponibilité de l'accès Internet
7
# - Ce script prévient les usagers de l'indisponibilité de l'accès Internet
Line 41... Line 41...
41
		echo "can't contact the default router"
41
		echo "can't contact the default router"
42
		/bin/sed -i "s?diagnostic =.*?diagnostic = \"can't contact the default router\";?g" $Index_Page
42
		/bin/sed -i "s?diagnostic =.*?diagnostic = \"can't contact the default router\";?g" $Index_Page
43
		;;
43
		;;
44
	esac
44
	esac
45
	net_pb=`grep "network_pb = true;" $Index_Page|wc -l`
45
	net_pb=`grep "network_pb = true;" $Index_Page|wc -l`
46
	if [ $net_pb = "0" ] # user alert (only the first time)	
46
	if [ $net_pb = "0" ] # user alert (only the first time)
47
		then
47
		then
48
		/bin/sed -i "s?^\$network_pb.*?\$network_pb = true;?g" $Index_Page
48
		/bin/sed -i "s?^\$network_pb.*?\$network_pb = true;?g" $Index_Page
49
		$IPTABLES -I PREROUTING -t nat -i $TUNIF -p udp --dport domain -j REDIRECT --to-port 56
49
		$IPTABLES -I PREROUTING -t nat -i $TUNIF -p udp --dport domain -j REDIRECT --to-port 56
50
	fi
50
	fi
51
}
51
}
Line 143... Line 143...
143
					chmod 644 /var/Save/security/watchdog.log
143
					chmod 644 /var/Save/security/watchdog.log
144
				fi
144
				fi
145
			fi
145
			fi
146
		done
146
		done
147
		;;
147
		;;
148
esac	
148
esac
149
IFS=$OLDIFS
149
IFS=$OLDIFS