Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #--------------{ Hostname Setup }----------------#
- #configure_hostname(){
- #read -p "Hostname [ex: tuxhatlinux]: " host_name
- #echo "$host_name" > /mnt/etc/hostname
- #}
- configure_hostname(){
- DIALOGRC=${DIALOGRC}
- DISTNAME='Tux Hat Linux '
- DISTVER='v3.4'
- DASH='-'
- SCRIPTNAME='Setup Hostname'
- CONFIGFILE=/home/gary/Test/setup-tuxhat.conf
- if [[ -f $CONFIGFILE ]]; then
- source $CONFIGFILE
- else
- echo "Error missing file: setup-tuxhat.conf - Required by program"
- exit 1
- fi
- ### Program for making the UI
- DIALOG=${DIALOG=dialog}
- #DIALOG=${DIALOG=Xdialog}
- # Temp files
- tmpfile=`tmpfile 2> /dev/null` || tmpfile=/tmp/tmpfile$$
- trap "rm -f $tmpfile" 0 1 2 5 15
- DIALOGRC="$DIALOGRC" $DIALOG --backtitle "$DISTNAME$DISTVER $DASH $SCRIPTNAME " --no-shadow \
- --inputbox "Please enter new Hostname [ex: tuxhatlinux]" 8 48 0> $tmpfile
- retval=$?
- case $retval in
- 0)
- `cat $tmpfile` > /mnt/etc/hostname
- ;;
- esac
- }
Advertisement
Add Comment
Please, Sign In to add comment