27
27
#considered as a configuration file
28
28
mkdir /etc/firestarter
29
29
cp -f /etc/firestarter.old/non-routables /etc/firestarter/non-routables
33
if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
34
#remove /etc/ppp/ip-up.local only if firestarter hook
35
#is the only one contained in it.
37
if [ -e /etc/ppp/ip-up.local ]; then
38
grep -v "firestarter\|^PATH" /etc/ppp/ip-up.local >/dev/null
40
#we can remove safely /etc/ppp/ip-up.local
41
rm -f /etc/ppp/ip-up.local
45
DHCP_HOOK=/etc/dhclient-exit-hooks
46
if [ -e $DHCP_HOOK ] && grep firestarter $DHCP_HOOK >/dev/null; then
47
TMP=`mktemp -q` && awk '
48
/PATH=\$PATH:\/sbin:\/usr\/sbin:\/bin:\/usr\/bin/ {
53
#if PATH... is used for firestarter then
54
#we remove PATH line and the next line (firestarter hook)
55
#else we keep these lines
56
if ($0 != "sh /etc/firestarter/firewall.sh")
63
/sh \/etc\/firestarter\/firewall.sh/ {
67
{print $0;}' < $DHCP_HOOK > $TMP && mv $TMP $DHCP_HOOK
31
#remove /etc/ppp/ip-up.local only if firestarter hook
32
#is the only one contained in it.
34
if [ -w /etc/ppp/ip-up.local ]; then
35
if grep -v "firestarter\|^PATH" /etc/ppp/ip-up.local >/dev/null; then
36
#TODO: fix this condition
40
#we can remove safely /etc/ppp/ip-up.local
41
rm -f /etc/ppp/ip-up.local
46
DHCP_HOOK=/etc/dhclient-exit-hooks
47
if [ -w $DHCP_HOOK ] && grep firestarter $DHCP_HOOK >/dev/null; then
48
TMP=`mktemp -q` && awk '
49
/PATH=\$PATH:\/sbin:\/usr\/sbin:\/bin:\/usr\/bin/ {
54
#if PATH... is used for firestarter then
55
#we remove PATH line and the next line (firestarter hook)
56
#else we keep these lines
57
if ($0 != "sh /etc/firestarter/firewall.sh")
64
/sh \/etc\/firestarter\/firewall.sh/ {
68
{print $0;}' < $DHCP_HOOK > $TMP && mv $TMP $DHCP_HOOK