Hi all ... just wanna say that I'm somewhat a novice with bash and just need some pointers. This script isnt complete... but, its at a point where I can run it to certain point to test. I'm writing this to use with friends and myself for semi-automated install. I'm having a problem with line 67 - 79 (ITS IN BOLD)
. I want it to begin downloading by pressing the (1) key, and if there is any break in the script or problem I want it to exit. The output suggests a syntax error... Just cant find it...
#Funtoo stage3 chroot Installation Script(x64 Core2 build)(2009-Beta)
#Installs from existing x64 distro
#Made by Manwithaplan
# You must have GPARTED installed & an active internet connection
# WARNING!!! Make sure you use the correct drive paths for SWAP, HOME, ROOT Or you'll overwrite your partitions
#Checks if user is root
if [ `id -u` != "0" ]; then
echo "Funtoo Installation Script 2009-beta-test script"
echo "Sorry, you are not root."
echo "Please restart script as root."
#When user is , it gives information about the script
echo "This script installs Funtoo 64bit core2 distro"
echo "Created by Manwithaplan"
echo "This is for Core2 (x64) machines only."
echo "Working internet connection is a must"
echo "And you must have gparted and wget installed"
echo "To continue press Enter..."
#Gives user opportunity to check its partitions
echo "The script will launch gparted, for you to set up your partitions..."
echo "If set, just close gparted"
echo "Press Enter to continue"
echo "Launching gparted..."
echo "It seems you've set your partitions, and you are ready to continue"
echo "Press Enter to continue"
#Asks for boot, swap and home partition
echo "What is the boot partition of your Funtoo installation?"
echo "Example : /dev/sdb1"
echo "What is the Swap partition?"
echo "What is your Funtoo (home) partition?"
#Activates Swap partition, mounts boot & home partition
mount $FUNTOOHOME /mnt/funtoo
mount $BOOTPART /mnt/funtoo/boot
#Downloading stage file
echo "Now where going to download the stage3 file..."
echo "Downloading from http://www.funtoo.org/"
echo "Press the (1) key to continue:"
if [ $INSTALL -eq 1]
echo "Downloading Stage3 file..."
echo "You must not have a working internet connection, or wget isn't installed"
echo "Press any key to quit"
#Unpacks Stage3 tar file
echo "Stage 3 file Downloaded"
echo "Press the Enter key to continue unpacking"
echo "Unpacking Stage 3 file..."
tar xvjpf stage3-*.tar.bz2
echo "Now Mounting Filesytem"
#Copies DNS information
echo "Copying DNS information"
cp -L /etc/resolv.conf /mnt/funtoo/etc/resolv.conf
#Mounts Proc filesystem
echo "Mounting proc filesystem"
mount -t proc none /mnt/funtoo/proc
#Binds Dev directory
echo "Binding dev directory"
mount -o bind /dev /mnt/funtoo/dev
#Chroots into new Enviroment"
echo "Chrooting into Enviroment"
chroot /mnt/funtoo /bin/bash
export PS1="(chroot) $PS1"
#You are now chrooted, and partitons mounted on system...
#Time to Edit /etc/make.conf to and any CFLAGS etc...
echo "Press Enter to edit make.conf"
# Downloading Funtoo portage
echo "Now we need to download the latest Funtoo snapshot"
echo "Located @ http://www.funtoo.org/linux/funtoo/snapshots/"
echo "Please download the funtoo snapshot file to.... /usr/portage/"
echo "For this we need to use your web client"
echo "Please choose which Browser want to use to download with"
echo "Remember to save it in /etc/portage/"
echo "Press (1) for firefox"
echo "Press (2) for epiphany"
echo "Press (3) for konqueror"
echo "Press (4) for opera"
echo "Press (5) for seamonkey"
echo "Please enter (1-5) to continue:"
if [ $DL -eq 1 ]
echo "Launching firefox, Please close to continue"
elif [ $DL -eq 2 ]
echo "Launching epiphany, Please close to continue"
elif [ $DL -eq 3 ]
echo "Launching konqueror, Please close to continue"
elif [ $DL -eq 4 ]
echo "Launching opera, Please close to continue"
elif [ $DL -eq 5 ]
echo "Launching seamonkey, Please close to continue"
echo "There must be a problem with your connection or browser"
echo "Press any key to exit...."
#Updates Portage Tree
#echo "Updating Portage tree"
#echo "Press any key to continue"
#script finished until here still working on finishing up with adding #some code to add meta packages for an X Desktop
Here's the output:
./Auto_gentoo_build.sh: line 71: [: missing `]'
Any help would be great Thanks to anyone in advance
DISREGARD.... I WAS MISSING A SPACE IN THE BRACKETS ...........