brennydoogles
July 21st, 2008, 04:12 AM
I am trying to write a bash script that will allow me to automatically install all of my favorite apps (including the addition of all of my custom software sources) whenever I re-install, as well as sharing these apps with all of my friends that I have been converting to Ubuntu. For this reason, I need my script to have a menu, so that those who don't want to install certain TYPES of apps don't have to. Here is what I have so far, but I am getting errors that have no real meaning to me. Have I made an obvious mistake??
#!/bin/bash
#Script to add appropriate sources for a new ubuntu installation, and install cool packages.
mainMenu () {
OPTIONS="'Add Software Sources (must be done once)' 'Install Games' 'Install Multimedia' 'Install Useful Applications' 'QUIT'"
select opt in $OPTIONS; do
if [ "$opt" = "Add Software Sources (must be done once)" ]; then
addSources()
elif [ "$opt" = "Install Games" ]; then
installGames()
elif [ "$opt" = "Install Multimedia" ]; then
installMultimedia()
elif [ "$opt" = "Install Useful Applications" ]; then
installApps()
elif [ "$opt" = "QUIT" ]; then
exit 0
else
clear
echo "That wasn't one of the options."
fi
break
done
}
addSources () {
echo "Adding software sources";
mainMenu()
}
installGames () {
echo "Installing Games";
mainMenu()
}
installMultimedia () {
echo "Installing Multimedia";
mainMenu()
}
installApps () {
echo "Installing Apps"
mainMenu()
}
mainMenu ()
Any help would be greatly appreciated!!!
P.S.-- I know the script does not actually install anything right now, I was just writing out the logic behind it so that I can test it without running unnecessary commands.
#!/bin/bash
#Script to add appropriate sources for a new ubuntu installation, and install cool packages.
mainMenu () {
OPTIONS="'Add Software Sources (must be done once)' 'Install Games' 'Install Multimedia' 'Install Useful Applications' 'QUIT'"
select opt in $OPTIONS; do
if [ "$opt" = "Add Software Sources (must be done once)" ]; then
addSources()
elif [ "$opt" = "Install Games" ]; then
installGames()
elif [ "$opt" = "Install Multimedia" ]; then
installMultimedia()
elif [ "$opt" = "Install Useful Applications" ]; then
installApps()
elif [ "$opt" = "QUIT" ]; then
exit 0
else
clear
echo "That wasn't one of the options."
fi
break
done
}
addSources () {
echo "Adding software sources";
mainMenu()
}
installGames () {
echo "Installing Games";
mainMenu()
}
installMultimedia () {
echo "Installing Multimedia";
mainMenu()
}
installApps () {
echo "Installing Apps"
mainMenu()
}
mainMenu ()
Any help would be greatly appreciated!!!
P.S.-- I know the script does not actually install anything right now, I was just writing out the logic behind it so that I can test it without running unnecessary commands.