Re: Script help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





$ IP="1234.2345.3456.4578"
$ echo $IP | cut -d. -f3
3456

  by the way, i don't think it solves any of your exact problems, but

$ man ipcalc



thanks all - i have 'solved' this in my case (no pun intended) with the following

ADDR=`ifconfig | grep inet | head -1 | awk {'print$2'} | cut -d. -f3`

case "$ADDR" in
   66)
wget http://192.168.10.4/cobbler/ks_mirror/posts/autofs/auto.xxx.66;
        ;;
   76)
wget http://192.168.10.4/cobbler/ks_mirror/posts/autofs/auto.xxx.76';
        ;;
   77)
wget http://192.168.10.4/cobbler/ks_mirror/posts/autofs/auto.xxx.77';
        ;;
   78)
wget http://192.168.10.4/cobbler/ks_mirror/posts/autofs/auto.xxx.78';
        ;;
   86)
wget http://192.168.10.4/cobbler/ks_mirror/posts/autofs/auto.xxx.86';
        ;;
   *)
wget http://192.168.10.4/cobbler/ks_mirror/posts/autofs/auto.xxx.default;
        ;;
esac


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux