Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #-------------------------------------------------------------------------------
- # Script Created by Vincent - EZ-Arch Project (ezarchproject@gmail.com)
- # Distro Sourceforge - https://sourceforge.net/projects/ezarchlinux/
- # Distro Dailymotion - http://www.dailymotion.com/ezarchproject
- #
- # I shall be using Dailymotion more for the videos instead of Youtube.
- #
- #-------------------------------------------------------------------------------
- #This program is free software: you can redistribute it and/or modify
- #it under the terms of the GNU General Public License as published by
- #the Free Software Foundation, either version 3 of the License, or
- #(at your option) any later version.
- #
- #This program is distributed in the hope that it will be useful,
- #but WITHOUT ANY WARRANTY; without even the implied warranty of
- #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- #GNU General Public License for more details.
- #
- #You should have received a copy of the GNU General Public License
- #along with this program. If not, see <http://www.gnu.org/licenses/>.
- #-------------------------------------------------------------------------------
- # Run this script after your first boot with archlinux (as root)
- #--------------------------------------------------------------------------------
- # Explaination of the Script:
- #
- # Console EZ-Arch Linux Installer using Dialog
- #
- #This is not complete but need to print it out at work
- ##########################################################################
- PROGDIR=/home/vincent/Projects/EzCUDM/rootfs/usr/INSTALLER/EzCUDM #Testing
- #PROGDIR=/usr/INSTALLER/EzCUDM
- # Top program dir is used for testing
- # Global Stuff
- CONFIGFILE=$PROGDIR/etc/ezarchinstall.conf # Config File
- if [[ -f $CONFIGFILE ]]; then
- source $CONFIGFILE
- else
- echo "Error missing file: ezarchinstall.conf - Required by program"
- echo "Installer's Directory is $PROGDIR/etc"
- exit 1
- fi
- # Linux name and version is set in its own config file.
- VERSIONINFO=$PROGDIR/etc/distver.conf
- if [[ -f $VERSIONINFO ]]; then
- source $VERSIONINFO
- else
- echo "Error missing file: distver.conf - Required by program"
- echo "Installer's Directory is $PROGDIR/etc"
- exit 1
- fi
- ### Program for making the UI
- DIALOG=${DIALOG=dialog}
- #DIALOG=${DIALOG=Xdialog}
- # Temp files
- tempfile=`tempfile 2> /dev/null` || tempfile=/tmp/tmpfile$$
- trap "rm -f $tempfile" 0 1 2 5 15
- # Tasks
- TASK1='-'
- ##################################################################################
- #
- # Menus and Menu options
- #
- ##################################################################################
- installrootmenu() # 1st Menu in the Installer
- {
- while :
- do
- $DIALOG --backtitle "$DISTNAME $DISTVER " --no-shadow \
- --ok-label 'Select' --cancel-label 'Exit' \
- --title "$FUNCTION" --menu "Select a menu option" 20 78 16 \
- "Keymap" "Select Keymap [$TASK1]" \
- "Network" "Configure Network" \
- "Disk Setup" "Disk Setup Menu ->" \
- "Installation" "Installation Menu ->" \
- "Fstab" "Create Fstab" \
- "Chroot" "Chroot to installed System" \
- "View Diskspace" "Shows disk spaces via df" \
- "View System Info" "Shows information about your system" \
- "Reboot" "Reboot System." \
- "Power Off" "Power off the System" 2> $tempfile
- mmretval=$?
- choice=`cat $tempfile`
- case $mmretval in
- 0)
- echo "Selected $choice "
- installrootmenuchoices
- ;;
- 1)
- if $DIALOG --yesno "Do you wish to exit.\n" 10 20
- then
- exit 0
- fi
- ;;
- 255)
- # echo "ESC key pressed"
- ;;
- esac
- done
- }
- installrootmenuchoices()
- {
- case $choice in
- "Keymap")
- TASK1='X'
- ;;
- "Network")
- ;;
- "Disk Setup")
- ;;
- "Installation")
- ;;
- "Fstab")
- ;;
- "Chroot")
- ;;
- "View Diskspace")
- #df -h | grep "^/" > statsfile.$$
- $DF -h > $TMP/statsfile.$$
- $DIALOG --backtitle "$DISTNAME $DISTVER" \
- --title "View Disk Spaces" \
- --textbox $TMP/statsfile.$$ 20 60
- rm -f $TMP/statsfile.$$
- ;;
- "View System Info")
- #-c 0 on Inxi disables Colors
- #
- inxi -F -c 0 > $TMP/statsfile.$$
- $DIALOG --backtitle "$DISTNAME $DISTVER" \
- --title "View System Information" \
- --textbox $TMP/statsfile.$$ 30 100
- rm -f $TMP/statsfile.$$
- ;;
- "Reboot")
- $REBOOT
- ;;
- "Power Off")
- $POWEROFF
- ;;
- esac
- }
- installrootmenu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement