I am new to Linux. Working with Slackware 12.0
I am trying to activate firewall with following code:
Code:
#!/bin/bash
set -x
start_firewall()
{
echo "Starting firewall..."
# flush & iptables
}
stop_firewall()
{
echo "Stopping firewall..."
# flush
}
case "$1" in
start)
echo "Will now start firewall."
start_firewall()
echo "Done."
stop)
echo "Will now stop firewall."
stop_firewall()
echo "Done."
restart)
echo "Will now restart firewall."
stop_firewall()
start_firewall()
echo "Done."
*)
echo "Usage $0 {start|stop|restart}"
esac
Getting error message:
Line 19: syntax error near unexpected token 'echo'
Line 19: ' echo "Done."'
Line 19 is the line in case selection, after start), after start_firewall(), echo "Done."
I have tried to:
1) change 1st line to #!/bin/sh
2) rewrite executable from 0 with mc edit and VIM
Can anybody help me? Thanks in advance.