45 lines
849 B
Bash
Executable File
45 lines
849 B
Bash
Executable File
#!/bin/sh
|
|
# Open HTTP port to the world.
|
|
NAME="60_allow_http"
|
|
|
|
start () {
|
|
log_progress_msg $NAME
|
|
remove 2> /dev/null # Try to remove functionality, if possible, so that
|
|
# start can be run multiple times in a row.
|
|
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
|
|
}
|
|
stop () {
|
|
log_progress_msg $NAME
|
|
remove
|
|
}
|
|
remove () {
|
|
iptables -D INPUT -p tcp --dport 80 -j ACCEPT
|
|
}
|
|
status () {
|
|
iptables -L INPUT
|
|
}
|
|
|
|
# You probably shouldn't edit anything below here.
|
|
test -f /lib/lsb/init-functions && . /lib/lsb/init-functions
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart|force-reload)
|
|
stop
|
|
start
|
|
;;
|
|
status)
|
|
status
|
|
exit 0
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart|force-reload|status}"
|
|
exit 1
|
|
;;
|
|
esac
|