#!/bin/sh # # Copyright 2011 Eric Hameleers, Eindhoven, NL # Copyright 2011 Patrick Volkerding, Sebeka, Minnesota USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Bug reports, suggestions, etc for pxesetup: alien@slackware.com # export TEXTDOMAIN=slint TMP=/var/log/setup/tmp if [ ! -d $TMP ]; then mkdir -p $TMP fi rm -f $TMP/SeT* # If a keymap was set up, restore that data: if [ -r $TMP/Pkeymap ]; then cp $TMP/Pkeymap $TMP/SeTkeymap fi echo "on" > $TMP/SeTcolor # turn on color menus PATH="$PATH:/usr/lib/setup" export PATH; export COLOR=on # Before probing, activate any LVM partitions that may exist from # before the boot - perhaps the Slint tree is on a local partition: vgchange -ay 1> /dev/null 2> /dev/null if probe -l 2> /dev/null | grep -E 'Linux$' 1> /dev/null 2> /dev/null ; then probe -l 2> /dev/null | grep -E 'Linux$' | sort 1> $TMP/SeTplist 2> /dev/null fi while [ 0 ]; do Version=14.1 dialog --visit-items --title "`eval_gettext "Slint PXE Setup (version \\\${Version})"`" \ --menu \ "`gettext "Welcome to Slint PXE Setup. Select an option below using the UP/DOWN keys and SPACE or ENTER. Alternate keys may also be used: '+', '-', and TAB."`" 14 80 7 \ "HELP" "`gettext "Read the Slint PXE Setup HELP file"`" \ "NETWORK" "`gettext "Configure your network parameters"`" \ "SOURCE" "`gettext "Select source media"`" \ "ACTIVATE" "`gettext "Activate the Slint PXE Server"`" \ "EXIT" "`gettext "Exit Slint PXE Setup"`" 2> $TMP/hdset if [ ! $? = 0 ]; then rm -f $TMP/hdset $TMP/SeT* exit fi MAINSELECT="`cat $TMP/hdset`" rm $TMP/hdset # Start checking what to do. Some modules may reset MAINSELECT to run the # next item in line. if [ "$MAINSELECT" = "HELP" ]; then SeTPXEHELP fi if [ "$MAINSELECT" = "NETWORK" ]; then SeTnet SeTpxe if [ -r $TMP/SeTpxe ]; then MAINSELECT="SOURCE" fi fi if [ "$MAINSELECT" = "SOURCE" ]; then SeTpxemedia if [ -r $TMP/SeTsource ]; then MAINSELECT="ACTIVATE" fi fi if [ "$MAINSELECT" = "ACTIVATE" ]; then if [ ! -r $TMP/SeTpxe -o ! -r $TMP/SeTsource ]; then dialog --title "`gettext "CANNOT START PXE SERVER YET"`" \ --msgbox "`gettext " Before you can start the PXE Server, complete the following tasks: 1. Set up your computer's network parameters. 2. Select your source media. Press ENTER to return to the main menu."`" 13 80 continue fi # Time to start the BOOTP/TFTP/HTTP servers: dnsmasq -C /etc/dnsmasq.conf httpd -h /var/log/mount dialog --backtitle "`gettext "Slint PXE Server."`" \ --title "`gettext "PXE Client activity log"`" \ --ok-label "`gettext "EXIT"`" \ --tailbox /var/log/dnsmasq.log 18 80 # Time to kill the BOOTP/TFTP/HTTP servers: kill -TERM $(cat /var/run/dnsmasq.pid) killall -TERM httpd fi if [ "$MAINSELECT" = "EXIT" ]; then break fi done # end of main loop rm -f $TMP/PXEhelp # end slackware PXE setup script