On 17 July 2012 13:49, Henri Gomez
Hi to all,
Any ideas why a command like ifconfig works when invoked from a %post hook when package is installed via rpm -Uvh but not when same package is installed via zypper from an external repository ?
%post
IP_LOC=`/sbin/ifconfig | grep "inet adr" | grep -v 127.0.0.1 | awk -F: '{print $2}' | awk '{print $1}' | awk -F. '{print $1"."$2}'` echo $IP_LOC
It will return blank if package is installed from zypper (zypper install) and your 2 first digits if installed via rpm -Uvh
Thanks for your help / advices
Why are you doing such a thing? What do you expect to happen if there are multiple interfaces? What if no interface has a IPv4 address? address is written with two 'd'. If there are any further differences probably are because one of them sets the locale to C. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org