]> www.pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/gpe-shield/ipshield
gpe-shield: don't install setuid root. clean up init script.
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / gpe-shield / ipshield
1 #! /bin/sh
2 #
3 # Startup script for gpe firewall engine. 
4 # Based on debian skeleton.
5 #       
6
7 set -e
8
9 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
10 GPE_SHIELD=/usr/bin/gpe-shield
11 IPTABLES=/usr/sbin/iptables
12 NAME=gpe-shield
13 DESC="GPE desktop firewall"
14
15 SCRIPTNAME=/etc/init.d/$NAME
16
17 # Gracefully exit if the package has been removed.
18 test -x $GPE_SHIELD || exit 0
19
20 # Read config file if it is present.
21 #if [ -r /etc/default/$NAME ]
22 #then
23 #       . /etc/default/$NAME
24 #fi
25
26
27 case "$1" in
28   start)
29         test -f /etc/access.conf || exit 0
30
31         echo -n "Starting $DESC: $NAME"
32         if [ -f /etc/gpe/gpe-shield-load ]
33         then
34                 $GPE_SHIELD --activate > /dev/null && echo -n " done"
35         else
36                 echo -n " deactivated"
37         fi
38         echo "."
39         ;;
40   stop)
41         echo -n "Stopping $DESC: $NAME"
42         ($IPTABLES --flush && $IPTABLES -P INPUT ACCEPT) > /dev/null &&  echo "."
43         ;;
44   *)
45         echo "Usage: $SCRIPTNAME {start|stop}" >&2
46         exit 1
47         ;;
48 esac
49
50 exit 0