I didn't bother reposting all the prior info for this..... starting with the current script..... we will go on from there
http://www.bashscripts.org/downloads/Sc ... fad.0.4.sh
Code:
#!/bin/bash
#
#########################
# Created by the #
# USA Linux Users Group #
# http://www.usalug.org #
#########################
#
######################################
# Find a Drug Linux Client installer #
# Developed at BashScripts.org #
# By Crouse #
######################################
#
########################
# Program Version .0.4 #
########################
#
######################
# Start of Variables #
######################
# The directory where FAD will be installed
faddirectory="/usr/local/findadrug"
# The actual version of the FAD program
fadprogramver=fadv125c.tgz
# Where the FAD program is downloaded from.
downloadurl="http://www.find-a-drug.org/fadv125c.tgz"
# The bashscripts.org version number of this script
scriptversion="0.4"
######################
# Start of Functions #
######################
checkforroot ()
{
echo "Checking for root permissions"
sleep 1
ROOT_UID=0
if [ "$UID" -ne "$ROOT_UID" ]
then
echo "********ERROR********"
sleep 1
echo "You must be logged in as root to run this script"
echo "Please log in as root and re-run this script."
sleep 1
echo "Aborting installation."
sleep 1
echo "This script is located in the following directory"
pwd
sleep 1
exit
fi
echo "Root permissions found."
}
fileextraction ()
{
# Download and Extract FAD
sleep 1
echo "Starting download of file now"
wget $downloadurl
echo "."
echo "File successfully downloaded"
sleep 1
echo "Now Creating the FAD Directory"
mkdir $faddirectory
echo "New Directory Created"
sleep 1
echo "Now moving dowloaded file to the new directory"
mv $fadprogramver $faddirectory
echo "File Moved"
sleep 1
echo "Starting extraction of the FAD program"
sleep 1
cd $faddirectory
tar zxvf $fadprogramver
echo "Files Extracted"
}
fadsetup ()
{
# Prompt for FAD setup variables
sleep 1
echo "Beginning Client Registration"
echo "You will be prompted for your username, email address, and team number"
sleep 1
# Prompt for username email and team number
# Suggested by jbsnake
read -p "Please enter your username: " uname
read -p "Please enter your email address: " eaddress
echo "Enter 2104 if you want to join the USA Linux Users Group team"
read -p "Please enter your team number: " tnumber
echo "y" | ./fadsetup -nickname "$uname" -team "$tnumber" -email "$eaddress" -connect "When online" -country "United
States"
# Note - should do some error checking to make sure that the person entered the information correctly here.
echo "Yes - This script auto-accepted the user agreement."
sleep 2
echo "Registration for TEAM $tnumber Complete."
sleep 1
echo "Now removing the installation file"
rm $fadprogramver
echo "File $fadprogramver removed"
sleep 1
echo "."
echo "."
echo "Congratulations $uname you have successfully installed the Linux Find-A-Drug Client"
echo "Installation Complete"
sleep 2
}
installnotes ()
{
# Notes for after installation has completed successfully
echo "."
echo "."
echo "----------NOTES---------"
echo "You may change the username by typing ./fadsetup -nickname YOURUSERNAMEHERE"
echo "You may check the status of your FAD client by typing ./server -list"
echo "If you need to restart your client --as ROOT-- cd $faddirectory ./loader"
echo "The script is being worked on at USALUG's bashscripts.org website"
echo "For the most up to date version visit: http://bashscripts.org/viewtopic.php?id=42"
echo "Download current versions of this script at: http://www.bashscripts.org/downloads/Scripts/crouse/"
echo "-------------------------"
echo "."
echo "."
echo "Installation script Version $scriptversion was created by Crouse for the USA Linux Users Group."
echo "Please visit us at http://www.usalug.org and also at http://www.bashscripts.org"
echo "."
sleep 3
}
listjobs ()
{
# Attempt to list the running jobs
echo "In a few seconds we will attempt to list your running client jobs"
echo "You should have a job running or a job in que. If not wait a few minutes and type ./server -list"
sleep 3
echo "Trying to list current jobs in process.... one moment please.. this will take 2 minutes.. please wait..."
echo "or you can hit CTL-C to end"
sleep 120
./server -list
sleep 3
echo "That's all Folks !!! :) "
}
####################
# End of Functions #
####################
###########################
# Program run starts here #
###########################
clear
# Program is broken down into segments(functions)
checkforroot
fileextraction
fadsetup
installnotes
listjobs
# end the program
exit