Register
It is currently Fri Oct 24, 2014 2:28 am

FAD install Script


All times are UTC - 6 hours


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 PostPosted: Tue May 17, 2005 8:17 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
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


Top
 Profile WWW  
 PostPosted: Fri Jul 22, 2005 7:28 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
Hmmmm definately need to update this script..... newer fad client out there.


Top
 Profile WWW  
 PostPosted: Fri Jul 29, 2005 11:56 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
i think you should also make that install script create some useful aliases for users. Like the fadstatus alias and the fadstart/fadstop aliases. Have it ask the user if they want the aliases, then have it add the aliases to the .bashrc file along with doing it on the command line (that way when they close the shell, it will be available next log in). Maybe even have it allow the user to increase the amount of think processes it will run (the think.env file). Just some ideas :)


Top
 Profile  
 PostPosted: Tue Aug 02, 2005 2:58 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
nice ideas :)


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP