Ok, so my script needs to run during the boot sequence. I'm assuming now, after failing to get the output, that I have to do something with STDOUT in order to have this displayed to the screen? Care to enlighten a lost soul?
Code:!/bin/bash # # Profiler - Choose network profile. # # Description: Allows users to choose which network profile they want to load \ # at boot time.. # # ## Function to actually set the profile ######################### Gold Version ################################################## #CONFDIR=/etc #setprofile () # { # rm $CONFDIR/sysconfig/network ; ln -s $CONFDIR/files/sysconfig/network.$PROFILE $CONFDIR/sysconfig/network # rm $CONFDIR/sysconfig/network-scripts/ifcfg-eth0 ; ln -s $CONFDIR/files/sysconfig/network-scripts/ifcfg-eth0.$PROFILE $CONFDIR/sysconfig/network-scripts/ifcfg-eth0 # rm $CONFDIR/hosts ; ln -s $CONFDIR/files/hosts.$PROFILE $CONFDIR/hosts # rm $CONFDIR/resolv.conf ; ln -s $CONFDIR/files/resolv.conf.$PROFILE $CONFDIR/resolv.conf # echo "$PROFILE profile loaded! Continuing to boot..." ; sleep 1 ; # } ######################### End Gold Version ############################################### ######################### Test Version (Remove when ready to go gold) #################### CONFDIR=/etc setprofile () { rm $CONFDIR/sysconfig/network ; ln -s $CONFDIR/profiler/network.$PROFILE $CONFDIR/sysconfig/network rm $CONFDIR/sysconfig/network-scripts/ifcfg-eth0 ; ln -s $CONFDIR/profiler/ifcfg-eth0.$PROFILE $CONFDIR/sysconfig/network-scripts/ifcfg-eth0 rm $CONFDIR/hosts ; ln -s $CONFDIR/profiler/hosts.$PROFILE $CONFDIR/hosts rm $CONFDIR/resolv.conf ; ln -s $CONFDIR/profiler/resolv.conf.$PROFILE $CONFDIR/resolv.conf echo "$PROFILE profile loaded! Continuing to boot..." ; sleep 1 ; } ######################### End test version ############################################## if [ ! -f /etc/profiler/profiles ]; then #if [ ! -f /home/poo/profiler/profiles ]; then # for testing, remove when ready to go gold. echo "Profile list not found. Please check and reinstall Profiler if necessary" ; exit 1 fi PROFILELIST=/etc/profiler/profiles #PROFILELIST=/home/poo/profiler/profiles # for testing, remove when ready to go gold. # Show shoices to the screen echo ; echo echo -e "\t\t\tNetwork Profiler" echo -e "\t\t\tPlease make your choice" echo ; echo ### Here is where we actually get the choice. There is a bit of sanity check to make sure they enter a correct choice while [ ! $PROFILE ] ; do select selection in `cat $PROFILELIST`; do case $selection in * ) PROFILE=$selection ; break ;; esac done done ### Now we have thier selection, below we do something with it! case $PROFILE in Create ) echo "not done yet";; #call profile creator here, recycle the script. * ) setprofile ;; #call profile set function here. esac exit 0
Bookmarks