Register
It is currently Sat Nov 22, 2014 4:26 am

Y/N User input


All times are UTC - 6 hours


Post new topic Reply to topic  [ 15 posts ] 
Author Message
 PostPosted: Tue Apr 15, 2008 12:49 pm   

Joined: Tue Apr 15, 2008 12:44 pm
Posts: 7
Hey all. Hopefully someone can help me out with this one. Im writing a bash script to run through some install processes, but I'm caught on how to properly set this up. What I wan done is to ask the user for Y/N input. If Y then install the rpm, if no. Goto the next Y/N question.


Mild example.

Would you like to install john the ripper? Y/N? (Yes is default)

if y do yum install -y john
if n goto next question

Hope this kind of make sense?!

I got the read input down, but its also being picky about what case the input is. I would like to have it take lower and upper.

R/

Vince


Top
 Profile  
 PostPosted: Tue Apr 15, 2008 2:17 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
i actually cover this in my intermediate tutorial located here
you can either read the whole thing... or just skim down til you see "function yesno"


Top
 Profile  
 PostPosted: Tue Apr 15, 2008 4:03 pm   

Joined: Tue Apr 15, 2008 12:44 pm
Posts: 7
I got the y/n input working, but I'm scratching my head on this one part.

Im asking the user to specify if they want to be prompted to install a tool on an individual basis, or as a group. The group install is the first option and the tool by tool is the second, but I want it to completely skip the second part if the do the group install.

Is there a way to jump to a certain line in the script to bypass ?


Sample script:

echo "Would you like to install the default tool package n/Y?"
echo ""
read a
if [[ $a == "N" || $a == "n" ]]; then
echo "The default tool package will not be installed."
else
echo "Installing the default tool package"

yum install -y p0f
yum install -y nbtscan
yum install -y wine

fi


R/

Vince


Top
 Profile  
 PostPosted: Tue Apr 15, 2008 4:50 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
well... that would be covered by an if/then/else...
you might be missing the logic in an if statement....
if the first condition is met... it executes that code block, and ignores the else portion....
if the first condition is NOT met... that code block is skipped and the else portion is executed instead...

so let's say you had this code:
Code:
if [[ "$a" == "1" ]]
then
     echo "1"
else
     echo "2"
fi

Ex 1: a=1
the output would be "1"

Ex 2: a=0
the output would be "2"

in neither example is more than one thing echoed. that's because only ONE thing can execute in this if/then/else code block

please read my intermediate tutorial here... it goes over if/then concepts and case/esac... i think it's right up your alley right now


Top
 Profile  
 PostPosted: Tue Apr 15, 2008 5:02 pm   

Joined: Tue Apr 15, 2008 12:44 pm
Posts: 7
jbsnake,

Thanks for the help. I apologize for sounding like a simpleton. I had the the magical "POP" of my head coming out of my butt when I was putting the key in the car on the drive home and figured out how to structure it.

Thanks again!

R/

Vince


Top
 Profile  
 PostPosted: Tue Apr 15, 2008 9:09 pm   

Joined: Tue Apr 15, 2008 12:44 pm
Posts: 7
Hey,

Ok, I thought I had it. There is something im obviously missing since im telling it else, go into another if statement. Below is the sample cold that I "thought" was going to work.

_____________________________________________________

#!/bin/bash

echo "We will now start installing the tools"
echo ""
echo ""
echo ""
echo ""
echo ""
echo "Would you like to install the default tool package n/Y?"
echo "If you decided not to install the default package you will be prompted for each indvidual tool"
read a
if [[ $a == "Y" || $a == "y" ]]; then

echo "Installing the default pentest tool package"
yum install p0f
yum install nbtscan


else
echo "You will now be prompted to install the "normal" tool list on an individual basis"
echo ""
echo "To speed the process, the default is YES (Just hit enter or y), otherwise hit n to NOT install the specified tool"
echo ""
echo ""
echo "Starting the individual install process"
echo ""
echo ""

echo "P0f v2 is a versatile passive OS fingerprinting tool. P0f can identify the system on machines that talk thru or near your box. p0f will also check masquerading and firewall presence, the distance to the remote system and its uptime, other guy's network hookup (DSL, OC3, avian carriers) and his ISP."
echo ""
echo ""
echo "Would you like to install p0f? n/Y?"
read a
if [[ $b == "N" || $b == "n" ]]; then

echo "p0f will not be installed."
else
echo "Installing p0f"

echo "NBTscan is a program for scanning IP networks for NetBIOS name information. It sends a NetBIOS status query to each address in supplied range and lists received information in human readable form. "
echo ""
echo ""
echo "Would you like to install Nbtscan n/Y"
read a
if [[ $a == "N" || $a == "n" ]]; then
echo "Nbtscan will not be installed."
else
echo "Installing Nbtscan"

yum install -y nbtscan
fi


Top
 Profile  
 PostPosted: Wed Apr 16, 2008 9:27 am   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
i believe you are forgetting to close some of your if statements... try putting some "fi" in the right places... they have to be in the right places to do what you are looking for.... but i think you are on the right track


Top
 Profile  
 PostPosted: Wed Apr 16, 2008 10:17 am   

Joined: Tue Apr 15, 2008 12:44 pm
Posts: 7
yeah, I got the fi's figured out. My major problem is that i have 96 tools(at this moment, more coming) to install. Which means I have 96 if statements to create, and then close. I tested with 10 and got everything working properly. Im guessing having that many fi's at the end are going to be a head scratcher to try and troubleshoot. I was thinking about a for loop with the y/n input in it, etc. But I'm so far into at this point, I really dont want to try and re-invent the weel.

I will probably kick myself in the rear for that when I actually have to start troubleshooting.

Thank you again for all the help!


Top
 Profile  
 PostPosted: Wed Apr 16, 2008 10:38 am   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
you wouldn't want all the fi's at the end i don't think... that would mean that all the functions are embedded into the else of the top-most if/then...
if i were you... (because the list of tools seems so long) i would make a list of the tools in a file... and loop through the file asking to install each...
that way you just have one loop... one if/then...


Top
 Profile  
 PostPosted: Wed Apr 16, 2008 11:40 am   

Joined: Tue Apr 01, 2008 10:19 am
Posts: 49
Try using the "case" statement and make your install things into functions. Perhaps rather than a long serious of yes/no questions, you would be better off doing a menu-system.

Example output
Code:
Please enter the number of the application you wish to install, or 0 to exit
1) foo
2) bar
3) baz
X) quoz
[...]
0) Exit

Your choice>


Top
 Profile  
 PostPosted: Wed Apr 16, 2008 12:10 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
Daenyth: I'm not sure a 96+ item menu list is the way to go here....


Top
 Profile  
 PostPosted: Wed Apr 16, 2008 1:40 pm   

Joined: Tue Apr 15, 2008 12:44 pm
Posts: 7
Yeah, the menu would be a pain to go through, simply due to the number of tools (96) (and that number is and will grow over time). Thanks for the post though!

I really liked the idea of the loop, but after some consideration I went with the "One script to rule them all" policy. I'm going to end up passing it out to other team members, so I wanted to keep it as simple for "user troubleshooting" as possible.

I have run a test through 26 of the 96 installs and everything is working great. I just have 96 fi's at the end of the install portion. Which looks really bad, but it gets the job done right? (I think im about ready to breach 2000+ lines of code in its entirety (rev 1). So i was just really trying to keep things as slim as possible. But, nothing but time ahead of me so I can always optimize later!

Thank you all for you help with this one! I truly appreciate it!


Top
 Profile  
 PostPosted: Wed Apr 16, 2008 2:50 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
can you try something for me?... just out of curiosity... can you run it and say No to... say... the 4th tool? See if it offers the 5th?... just wondering.


Top
 Profile  
 PostPosted: Wed Apr 16, 2008 3:01 pm   

Joined: Tue Apr 15, 2008 12:44 pm
Posts: 7
Yeah,

Issue. I was testing it not installing the tools (already installed on my laptop). So when I say No to a tool, it will go to the next tool, but if I say YES it installs the tool and then stops.


CRAP!

Im guessing I can put in another then statment after the install, like

yum install nmap; then

But how would I jump into the next tool install part?

Example script
[code]

#!/bin/bash


################################################################################
#YUM YUM #
################################################################################

#kill the XXXXXX pirut auto update process
#This dosent work...Y?
#kill 'ps aux|grep "/usr/bin/python -tt /usr/sbin/pirut"|grep root|grep -v grep |cut -d " " -f7'


clear

echo "We will now start installing the pentest tools"
echo ""
echo ""
echo ""
echo ""
echo ""
echo "Would you like to install the default tool package n/Y?"
echo "If you decided not to install the default package you will be prompted for each indvidual tool"
echo ""
read a
if [[ $a == "Y" || $a == "y" ]]; then


echo "Installing the default pentest tool package"

yum install -y p0f
yum install -y aircrack-ng
yum install -y airsnort
yum install -y arp-scan
yum install -y cabextract
yum install -y cpan
yum install -y cups-pdf
yum install -y deluge
yum install -y DMitry
yum install -y dsniff
yum install -y Etherape
yum install -y firewalk
yum install -y fping
yum install -y fwbuilder
yum install -y gcc
yum install -y gcc-c++
yum install -y gnome-applet-sensors
yum install -y gnomebaker
yum install -y gparted
yum install -y gpsd
yum install -y gpsd-clients
yum install -y gpsd-devel
yum install -y gpsdrive
yum install -y gq
yum install -y gstreamer-plugins-bad
yum install -y gstreamer-plugins-ugly
yum install -y gtk2-devel
yum install -y hping3
yum install -y ike-scan
yum install -y k3b
yum install -y kchmviewer
yum install -y kdeutils
yum install -y kernel-devel
yum install -y kismet
yum install -y kismet-extras
yum install -y ksensors
yum install -y libdvdcss
yum install -y libid3tag
yum install -y libmad
yum install -y libpcap
yum install -y libpcap-devel
yum install -y lynx
yum install -y mplayer
yum install -y mplayer-fonts
yum install -y mplayer-gui
yum install -y mplayerplug-in
yum install -y mplayer-skins
yum install -y mysql-server
yum install -y nbtscan
yum install -y ncftp
yum install -y nikto
yum install -y nmap
yum install -y nmap-frontend
yum install -y perl-Gtk2
yum install -y perl-Gtk2-Ex-Utils
yum install -y perl-Nmap-Parser
yum install -y php-mysql
yum install -y pptp
yum install -y proftpd
yum install -y pygtk2
yum install -y qtparted
yum install -y rdesktop
yum install -y revisor
yum install -y rss-glx-gnome-screensaver
yum install -y ruby-devel
yum install -y rusers
yum install -y scanssh
yum install -y screen
yum install -y smb4k
yum install -y smb4k-devel
yum install -y squashfs-tools
yum install -y svn
yum install -y tcsh
yum install -y testdisk
yum install -y tftp.i386
yum install -y tftp-server
yum install -y thinkfinger
yum install -y thunderbird
yum install -y tsclient
yum install -y unrar
yum install -y vlc
yum install -y vnc
yum install -y vsftpd
yum install -y wc3 #MAKE SURE THIS IS CORRECT#
yum install -y wine
yum install -y wireshark
yum install -y wireshark-gnome
yum install -y xine
yum install -y xine-lib
yum install -y xine-lib-extras-nonfree
yum install -y xine-skins
yum install -y xmms
yum install -y xmms-faad2
yum install -y xmms-mp3
yum install -y xprobe2

else

clear

echo "You will now be prompted to install the normal pentest tool list on an indvidual basis"
echo ""
echo "To speed the process, the default is YES (Just hit enter or y), otherwise hit n to NOT install the specified tool"
echo ""
echo ""
echo "Starting the indvidual install process"
echo ""
echo ""

echo "P0f v2 is a versatile passive OS fingerprinting tool. P0f can identify the system on machines that talk thru or near your box. p0f will also check masquerading and firewall presence, the distance to the remote system and its uptime, other guy's network hookup (DSL, OC3, avian carriers) and his ISP."
echo ""
echo ""
echo "Would you like to install p0f? n/Y?"
read a
if [[ $a == "Y" || $a == "y" || $a = "" ]];then

echo "Installing p0f"

yum install -y p0f
else

clear

echo "NBTscan is a program for scanning IP networks for NetBIOS name information. It sends a NetBIOS status query to each address in supplied range and lists received information in human readable form. "
echo ""
echo ""
echo "Would you like to install Nbtscan n/Y"

read a
if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing Nbtscan"

yum install -y nbtscan

else

clear

echo "While Wine is usually thought of as a Windows(TM) emulator, the Wine developers would prefer that users thought of Wine as a Windows compatibility layer for UNIX. This package includes a program loader, which allows unmodified Windows 3.x/9x/NT binaries to run on x86 and x86_64 Unixes. Wine does not require MS Windows, but it can use native system .dll files if they are available."
echo ""
echo ""
echo "Would you like to install Wine, n/Y?"

read a
if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing Wine."

yum install -y wine
else
clear

echo "aircrack-ng is a set of tools for auditing wireless networks. It's an enhanced/reborn version of aircrack. It consists of airodump-ng (an 802.11 packet capture program), aireplay-ng (an 802.11 packet injection program), aircrack (static WEP and WPA-PSK cracking), airdecap-ng (decrypts WEP/WPA capture files), and some tools to handle capture files (merge, convert, etc.). "
echo ""
echo ""
echo "Would you like to install Aircrack?, n/Y"

read
if [[$a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing Aircrack"

yum install -y aircrack-ng

else

clear

echo "AirSnort is a wireless LAN (WLAN) tool which recovers encryption keys. AirSnort operates by passively monitoring transmissions, computing the encryption key when enough packets have been gathered."
echo ""
echo "802.11b, using the Wired Equivalent Protocol (WEP), is crippled with numerous security flaws. Most damning of these is the weakness described in Weaknesses in the Key Scheduling Algorithm of RC4 by Scott Fluhrer, Itsik Mantin and Adi Shamir. Adam Stubblefield was the first to implement this attack, but he has not made his software public. AirSnort, along with WEPCrack, which was released about the same time as AirSnort, are the first publicly available implementaions of this attack."
echo ""
echo "AirSnort requires approximately 5-10 million encrypted packets to be gathered. Once enough packets have been gathered, AirSnort can guess the encryption password in under a second."
echo ""
echo ""
echo "Would you like to install Airsnort, n/Y?"

read a
if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing Aircrack"

yum install -y airsnort
else

clear

echo "Firewall Builder consists of a GUI and set of policy compilers for various firewall platforms. It helps users maintain a database of objects and allows policy editing using simple drag-and-drop operations. GUI generates firewall description in the form of XML file, which compilers then interpret and generate platform-specific code. Several algorithms are provided for automated network objects discovery and bulk import of data. The GUI and policy compilers are completely independent, this provides for a consistent abstract model and the same GUI for different firewall platforms. "
echo ""
echo ""
echo "Would you like to install Firewall Builder, n/Y?"

read a
if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing Firewall Builder"

yum install -y fwbuilder

else

clear

echo "GNOME Sensors Applet is an applet for the GNOME Panel to display readings from hardware sensors, including CPU and system temperatures, fan speeds and voltage readings under Linux. Can interface via the Linux kernel i2c modules, or the i8k kernel module (for Dell Inspirion 8000 Laptops). Includes a simple, yet highly customizable display and intuitive user-interface. Alarms can be set for each sensor to notify the user once a certain value has been reached, and can be configured to execute a given command at given repeated intervals. GNOME HIG v2.0 compliant."
echo ""
echo ""
echo "Would you like to install Gnome Sensors Applet, n/Y?"

read a
if [[ $a == "y" || $a == "Y" ]]; then

echo "Installing GNOME Sensors Applet"

yum install -y gnome-applet-sensors

else

clear

echo "GParted stands for Gnome Partition Editor and is a graphical frontend to libparted. Among other features it supports creating, resizing, moving and copying of partitions. Also several (optional) filesystem tools provide support for filesystems not included in libparted. These optional packages will be detected at runtime and don't require a rebuild of GParted."
echo ""
echo ""
echo "Would you like to install GParted, n/Y?"

read a
if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing GParted"

yum install -y gparted

else

clear

echo "GQ is a graphical browser for LDAP directories and schemas. Using GQ, an administrator can search through a directory and modify objects stored in that directory."
echo ""
echo ""
echo "Would you like to install GQ?, n/Y?"

read a
if [[ $a == "y" || $a == "Y" ]]; then

echo "Installing GQ"

yum install -y gq

else
clear

echo "K3b provides a comfortable user interface to perform most CD/DVD burning tasks. While the experienced user can take influence in all steps of the burning process the beginner may find comfort in the automatic settings and the reasonable k3b defaults which allow a quick start."
echo ""
echo ""
echo "Would you like to install K3b, n/Y?"

read a
if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing K3b"

yum install -y k3b
else
clear


echo "KSensors is a nice lm-sensors frontend for the K Desktop Environment. Install the hddtemp package if you wish to monitor hard disk temperatures with KSensors."
echo ""
echo ""
echo "Would you like to install KSensors, n/Y?"

read a
if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing KSensors"

yum install -y ksensors

else
clear

echo "Lynx is a text-based Web browser. Lynx does not display any images, but it does support frames, tables, and most other HTML tags. One advantage Lynx has over graphical browsers is speed; Lynx starts and exits quickly and swiftly displays webpages."
echo ""
echo ""
echo "Would you like to install Lynx, n/Y?"
read a

if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing Lynx"

yum install -y lynx

else
clear

echo "GNOME MPlayer is a simple GUI for MPlayer. It is intended to be a nice tight player and provide a simple and clean interface to MPlayer. GNOME MPlayer has a rich API that is exposed via DBus. Using DBus you can control a single or multiple instances of GNOME MPlayer from a single command."
echo ""
echo ""
echo "Would you like to install GNOME MPlayer, n/Y?"

read a
if [[ $a == "y" || $a == "Y" ]]; then

echo "Installing GNOME MPlayer"

yum install -y mplayer
else
clear

echo "This MPLayer-Gui package contains a GUI for MPlayer and a default skin for it."
echo ""
echo ""
echo "Would you like to install the GUI for MPlayer, n/Y?"

read a
if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing GNOME MPlayer GUI"

yum install -y mplayer-gui

else
clear

echo "MySQL is a multi-user, multi-threaded SQL database server. MySQL is a client/server implementation consisting of a server daemon (mysqld) and many different client programs and libraries. This package contains the MySQL server and some accompanying files and directories."
echo ""
echo ""
echo "Would you like to install MySQL, n/Y?"

read a
if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing MySQL"

yum install -y mysql-server

else
clear

echo "Nikto is a web server scanner which performs comprehensive tests against web servers for multiple items, including over 3300 potentially dangerous files/CGIs, versions on over 625 servers, and version specific problems on over 230 servers. Scan items and plugins are frequently updated and can be automatically updated (if desired)."
echo ""
echo ""
echo "Would you like to install Nikto, n/Y?"

read a
if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing Nikto"

yum install -y nikto

else
clear

echo "Nmap is a utility for network exploration or security auditing. It supports ping scanning (determine which hosts are up), many port scanning techniques (determine what services the hosts are offering), and TCP/IP fingerprinting (remote host operating system identification). Nmap also offers flexible target and port specification, decoy scanning, determination of TCP sequence predictability characteristics, reverse-identd scanning, and more."
echo ""
echo ""
echo "Would you like to install Nmap, n/Y?"

read a
if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing Nmap"

yum install -y nmap

else
clear

echo "This package includes zenmap, a GTK+ frontend for nmap. The nmap package must be installed before installing nmap-frontend."
echo ""
echo ""
echo "Would you like to install Nmap-Frontend, n/Y?"

read a
if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing Nmap-Frontend"

yum install -y nmap-frontend

else
clear

echo "This module implements a interface to the information contained in an nmap scan. It is implemented by parsing the xml scan data that is generated by nmap. This will enable anyone who utilizes nmap to quickly create fast and robust security scripts that utilize the powerful port scanning abilities of nmap."
echo ""
echo ""
echo "Would you like to install Perl-Nmap-Parser, n/Y?"

read a
if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing Perl-Nmap-Parser"

yum install -y perl-Nmap-Parser

else
clear

echo "Client for the proprietary Microsoft Point-to-Point Tunneling Protocol, PPTP. Allows connection to a PPTP based VPN as used by employers and some cable and ADSL service providers."
echo ""
echo ""
echo "Would you like to install PPTP, n/Y?"

read a
if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing PPTP"

yum install -y pptp

else
clear


echo "tsclient is a frontend that makes it easy to use rdesktop and vncviewer. You will need to install rdesktop or vnc in addition to tsclient."
echo ""
echo ""
echo "Would you like to install TSCleint, n/Y?"

read a
if [[ $a == "y" || $a == "Y" || $a = "" ]]; then

echo "Installing TSClient"

yum install -y tsclient

else
clear


echo "done with script"

fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi


Top
 Profile  
 PostPosted: Wed Apr 16, 2008 3:15 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
here's an example of the way i was talking about... with the file and the loop... first... you need a file with the list of tools and their descriptions (make sure the name of the package is what you would use to call yum with... and that you use a | to separate the name of the package with the description) :
tools.lst wrote:
p0f|P0f v2 is a versatile passive OS fingerprinting tool. P0f can identify the system on machines that talk thru or near your box. p0f will also check masquerading and firewall presence, the distance to the remote system and its uptime, other guy's network hookup (DSL, OC3, avian carriers) and his ISP.
nbtscan|NBTscan is a program for scanning IP networks for NetBIOS name information. It sends a NetBIOS status query to each address in supplied range and lists received information in human readable form.

now the list above we would call "tools.lst" and have it in the same directory as the script. the format of the list would be: package name|description
the online time you press enter when filling out that list would be when you were going on to the next tool

now let's take a stab at the script:
Code:
$!/bin/bash

echo "We will now start installing the tools"
echo ""
echo ""
echo ""
echo ""
echo ""
echo "Would you like to install the default tool package n/Y?"
read -p "If you decided not to install the default package you will be prompted for each indvidual tool: " a
if [[ $a == "Y" || $a == "y" || $a == "" ]]
then
      echo "Installing the default pentest tool package"
      until ! read cur_tool
      do
            package_name=`echo "$cur_tool" | cut -d\| -f1`
            yum install -y $package_name
      done < tools.lst
else
      echo "You will now be prompted to install the "normal" tool list on an individual basis"
      echo ""
      echo "To speed the process, the default is YES (Just hit enter or y), otherwise hit n to NOT install the specified tool"
      echo ""
      echo ""
      echo "Starting the individual install process"
      echo ""
      echo ""
      until ! read cur_tool
      do
            package_name=`echo "$cur_tool" | cut -d\| -f1`
            desc=`echo "$cur_tool" | cut -d\| -f2`
            echo "$desc"
            echo ""
            echo ""
            read -p "Would you like to install ${package_name}? n/Y? " b
            if [[ $b == "N" || $b == "n" ]]
            then
                  echo "${package_name} will not be installed."
            else
                  echo "Installing ${package_name}..."
                  yum install -y $package_name
            fi
      done < tools.lst
fi


that loop will go through the whole list and do each one... that's why it's important not to press enter until you are doing the next tool...


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 6 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