Re: Script help

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

 



On Tue, 12 Feb 2008, Tom Brown wrote:

>
> >
> > $ 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

what about:

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

  i'm fairly sure that would work.

rday
--


========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux