Hi
I want run a bash scrip at boot. However I have an error. What is wrong with my script ?
#!/bin/sh /etc/rc.common
# Example script
START=40
start() {
file="ipcam.txt"
while IFS=: read -r xf1 xf2 xf3
do
printf 'Loop: %s %s %s\n' "$xf1" "$xf2" "$xf3"
f1=$xf1
f2=$xf2
f3=$xf3
done < "$file"
printf 'After: %s %s %s\n' "$f1" "$f2" "$f3"
echo "script started"
iptables -t nat -A PREROUTING -p tcp --dport $f2 -j DNAT --to-destination $f1:$f3
root@mylinkit:/etc/init.d# ./ipcam start
Loop: 192.168.0.159
Loop: 554
Loop: 554
After: 554
script start
iptables v1.4.21: invalid port/service `-j' specified
Try `iptables -h' or 'iptables --help' for more information.
root@mylinkit:/etc/init.d#
(Last edited by enkavak on 14 Jul 2017, 12:26)