Fedora Linux Support Community & Resources Center
Prev Previous Post   Next Post Next
  #1  
Old 26th February 2012, 01:05 AM
mcojettech737 Offline
Registered User
 
Join Date: Jan 2012
Location: Florida
Posts: 53
linuxfirefox
Talking help with a shell script

F16 x86_64 raid level 6

i had to start modifing it because it wouldn't run its first linw was #!/bin/csh .. i change the end to /sh but now i get a syntax error on line 5.. see below
from the terminal i get:

[fred@localhost ~]$ cd Documents
[fred@localhost Documents]$ cd disk
[fred@localhost disk]$ ./install.sh

./install.sh: line 5: syntax error near unexpected token `$1'
./install.sh: line 5: ` switch ($1)'
[fred@localhost disk]$

Here's part of the script:

#!/bin/sh
echo " "
set requireSetupType="1"
if ($#argv > 0) then
switch ($1)
case "-notrap":
set requireSetupType="1"
breaksw
case "-ru":
set requireSetupType="1"
breaksw
default:
set requireSetupType="0"
breaksw
endsw
endif
if ("$requireSetupType" == "1") then
echo "STOP! BEFORE YOU INSTALL THIS SOFTWARE CAREFULLY READ THIS SOFTWARE

whole bunch of echo stuff went here for the software agreement

echo -n Press Y to accept the License Agreement :
set EULA = $<
if ( "$EULA" != "y" && "$EULA" != "Y" ) then
echo "EULA declined by User. Exiting installation..."
exit(1);
endif
endif
set firstArgDone="0"
set removepopup="0"
set removesnmp="0"
if ("$requireSetupType" == "1") then
while(1)
clear
echo "Press 0 to exit from installation"
echo "Choose[1-3]:"
echo " (1) - Complete"
echo " This option will install all program features."
echo " (2) - Client"
echo " This option will only install components required to remotely view and"
echo " configure servers."
echo " (3) - StandAlone"
echo " This option will only install components required for local server management"
echo "Note : Installer can also be run in a command line mode"
echo "Usage : install.sh [-option]"
echo "The options are :"
echo " a"
echo " The Complete Installation of MegaRAID Storage Manager (MSM) "
echo " c"
echo " The Client components only program of MSM"
echo " s"
echo " The StandAlone component of MSM"
echo -n Setup Type :
set setuptype = $<
if (0 <= $setuptype && $setuptype < 4) then
break;
endif
end
else
switch($1)
case "-a":
set setuptype="1"
set firstArgDone="1"
breaksw
case "-c":
set setuptype="2"
set firstArgDone="1"
breaksw
case "-s":
set setuptype="3"
set firstArgDone="1"
breaksw
default:
if ( $1 == "-notrap" ) then
breaksw
endif
echo "Badly Formatted Aruguments....."
echo "Usage : install.sh [-option]"
echo "The options are :"
echo " a"
echo " The Complete Installation of MegaRAID Storage Manager (MSM) "
echo " c"
echo " The Client components only program of MSM"
echo " s"
echo " The StandAlone component of MSM"
exit
endsw
endif

switch($setuptype)
case "1":
echo -n "Starting complete installation of MegaRAID Storage Manager 2.64-00"
set setuptype="a"
breaksw
case "2":
echo -n "Starting client installation of MegaRAID Storage Manager 2.64-00"
set setuptype="c"
breaksw
case "3":
echo -n "Starting stand alone installation of MegaRAID Storage Manager 2.64-00"
set setuptype="s"
breaksw
default:
set setuptype="0"
breaksw
endsw

if ( $setuptype == "0" ) then
exit
endif

set firstArg="n"
set secondArg="n"
if ($firstArgDone == "1") then
set firstArg=$2
set secondArg=$3
else
set firstArg=$1
set secondArg=$2
endif
switch($firstArg)
case "-ru":
switch ($secondArg)
case "popup":
set removepopup="1"
echo -n " without popup"
breaksw
case "snmp":
set removesnmp="1"
echo -n " without snmp"
breaksw
case "popup,snmp":
set removepopup="1"
set removesnmp="1"
echo -n " without popup,snmp"
breaksw
case "snmp,popup":
set removepopup="1"
set removesnmp="1"
echo -n " without popup,snmp"
breaksw
endsw
breaksw
endsw
endif

echo "...."

set TRAPIND="Y"

if ( "$1" == "-notrap" ) then
set TRAPIND="N"
endif
if ( "$2" == "-notrap" ) then
set TRAPIND="N"
endif
if ( "$3" == "-notrap" ) then
set TRAPIND="N"
endif
if ( "$4" == "-notrap" ) then
set TRAPIND="N"
endif

setenv setuptype $setuptype
setenv removepopup $removepopup
setenv removesnmp $removesnmp
setenv TRAPIND $TRAPIND

./RunRPM.sh

anyway i need it to install software monitoring for my LSI MegaRaid controller the app icon is supposed to show up in system tools

Thanks so much............

Last edited by mcojettech737; 26th February 2012 at 01:22 AM.
Reply With Quote
 

Tags
script, shell

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
call remote shell script within an expect script PhillyFloyd Programming & Packaging 2 16th October 2007 10:29 PM
starting a shell script inside a php script gw348 Using Fedora 6 23rd April 2007 09:30 PM
shell script Wangberg Programming & Packaging 13 4th April 2007 04:48 PM
ssh + shell script zslevi Using Fedora 8 9th January 2006 07:21 AM
need to run script Bourne-shell script armen Using Fedora 4 4th April 2005 01:16 PM


Current GMT-time: 20:11 (Saturday, 20-12-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
...Bern-Belp Airport (BRN) - Spring Creek Mountain Cafe and Cottages - Yorktown Virgina Photos on Instagram - Le Mont Dol Travel Photos - Abavas Rumba