Hi Wong, On Thu, 01 Oct 2009, 13:41:29 +0200, Wong wrote:
[...]
hmm, works perfectly well here. Do you have any LANG or LC_* variables set to some other value than C, POSIX, or en_US? If yes, you should prefix the /sbin/ifconfig with "env LANG=POSIX LC_ALL=POSIX".
My apologize to misinform, your sample of script is able to run. I missed the ' sign after .*$,\1,p. Below the result:
Server:~ # /sbin/ifconfig eth1 | sed -n -e 's,.*inet addr:[ ]*([^ ]*) .*$,\1,p' 192.168.1.1
But it result same issue if run in boot.local
Which issue?
[...]
can you add "set -x" to your script and post the output from running the script?
Where can I put the command?
Right after the '#! /bin/sh' line.
Does the line #! /bin/sh cause the issue? In RH9 it was #! /bin/bash.
no, that would be highly unlikely, at least in a "normal" setup ;-) Please show the output from the following commands:
# ls -als /bin/sh # rpm -qf /bin/sh
Here it is:
Server:~ # ls -als /bin/sh 0 lrwxrwxrwx 1 root root 4 Sep 4 14:11 /bin/sh -> bash
Server:~ # rpm -qf /bin/sh bash-3.2-141.10
This looks OK.
Here is my boot.local scripts
#! /bin/sh #
You could add here: set -x export LANG=POSIX export LC_ALL=POSIX
iptables -F iptables --table nat --flush iptables --delete-chain iptables --table nat --delete-chain
#EXT_IP=`/sbin/ifconfig eth0 | grep inet | cut -d : -f 2 | cut -d \ -f 1` EXT_IP=`/sbin/ifconfig eth0 | sed -n -e 's,.*inet addr:[ ]*([^ ]*) .*$,\1,p'`
Make sure, this is *one* line! So this should be: EXT_IP=`/sbin/ifconfig eth0 | sed -n -e 's,.*inet addr:[ ]*([^ ]*) .*$,\1,p'`
#INT_IP=`/sbin/ifconfig eth1 | grep inet | cut -d : -f 2 | cut -d \ -f 1` INT_IP=`/sbin/ifconfig eth1 | sed -n -e 's,.*inet addr:[ ]*([^ ]*) .*$,\1,p'`
Same here! INT_IP=`/sbin/ifconfig eth1 | sed -n -e 's,.*inet addr:[ ]*([^ ]*) .*$,\1,p'`
INTRANET="192.168.1.0/24"
iptables -A INPUT -s 0/0 -d $EXT_IP -p tcp --dport 25 -j ACCEPT iptables -A FORWARD -s $INTRANET -d ! $INT_IP -p tcp --dport 25 -j LOG iptables -A FORWARD -s $INTRANET -d ! $INT_IP -p tcp --dport 25 -j DROP
All scripts that use $EXT_IP and $INT_IP are unable run.
Thanks a lot, Manfred.
You're welcome, but, please don't copy me on every e-mail as I'm subscribed to this list ;-)
Wong
Cheers. l8er manfred -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org