The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 01-22-2008
dave123 dave123 is offline
Registered User
 

Join Date: Dec 2007
Posts: 45
Hi thanks for your reply, it doesnt work im afraid, the problem is i dont want it to run another script, i just want it to carry on with the same script,
below is a example of the script , what i would like is for the script to ask for root password if not in root and then carry on once the root password has been entered, im sure there must be a way.

Quote:
#!/bin/bash

typeset -r YUM="`which yum`"
typeset -r RPM="`which rpm`"

if [ $(whoami) != "root" ] ; then
echo sorry, you must be root to run this script >&2
exit 1
fi

$YUM -y install libXp compat-libstdc++-33 compat-libstdc++-296 wget
wget http://www.frostwire.com/download/?os=redhat
$RPM -Uvh --nodeps frostwire*.rpm
rm -f frostwire*.rpm
Reply With Quote