Bekijk de volledige versie : post-firewall issue

03-10-2006, 09:36
Hi all,

Iím trying to use post-firewall in the /usr/local/sbin directory though each time I try to run it I get an error of (-sh: /usr/local/sbin/post-firewall: not found)

I know the settings work because I can cut and paste into the CLI but for some reason it wonít in the file?

Iím sure it should work, can anyone help?

The script "post-firewall":
/usr/sbin/iptables -t nat -I PREROUTING -s X.X.X.X -p tcp --dport 3389 -j DNAT --to
/usr/sbin/iptables -I FORWARD -s X.X.X.X -p tcp -d --dport 3389 -j ACCEPT

The Direcory attributes:
[admin@ASUS root]$ ls /usr/local/sbin -all
drwxr-xr-x 1 admin root 0 Jan 1 1970 .
drwxr-xr-x 1 admin root 0 Jan 1 2000 ..
-rwxr-xr-x 1 admin root 598 Oct 2 15:15 post-boot
-rwxr-xr-x 1 admin root 262 Oct 3 17:26 post-firewall
-rwxr-xr-x 1 admin root 0 Oct 3 17:23 post-mount
-rwxr-xr-x 1 admin root 0 Oct 3 17:24 pre-shutdown

Trying to run it from the CLI:
[admin@ASUS root]$ /usr/local/sbin/post-firewall
-sh: /usr/local/sbin/post-firewall: not found


04-10-2006, 00:52
Fixed it,

I deleted the file and recreated it, that fixed it for some strange reason:confused: