Sponsored Content
Top Forums Shell Programming and Scripting Need help! Linux shell script Post 302599690 by chakrv1 on Friday 17th of February 2012 11:22:06 PM
Old 02-18-2012
Network Need help! Linux shell script

Hi all,
I am trying to make a Nodemanager work in RHEL 5
I got this script from 'oraclemiddleware.wordpress.com', and made appropriate changes to suit my weblogic installation.
I keep getting the error, "line 82: syntax error: unexpected end of file".
I have checked every line to make sure all quotes and brackets as properly closed. I also ran it with -x and -nv, but to no avail.
I would really appreciate it, if someone can take a look at the script, and let me know where the problem is.
Here is the whole script:-
--------------------------------------------------------------------------------
Code:
#!/bin/sh

MW_HOME=/home/vasan/Oracle/Middleware
JAVA_HOME=/home/vasan/Oracle/Middleware/jrockit_160_29_D1.2.0-10
DAEMON_USER="vasan"
PROCESS_STRING="weblogic.NodeManager"
WL_HOME=/home/vasan/Oracle/Middleware/wlserver_12.1

source $WL_HOME/server/bin/setWLSEnv.sh > /dev/null
export NodeManagerHome=”$WL_HOME/common/nodemanager”
NodeManagerLockFile=”$NodeManagerHome/nodemanager.lok”

PROGRAM=”$MW_HOME/wlserver_12.1/server/bin/startNodeManager.sh”
SERVICE_NAME=`/bin/basename $0`
LOCKFILE=”/var/lock/subsys/$SERVICE_NAME”

RETVAL=0

start() {
  OLDPID=`/usr/bin/pgrep -f $PROCESS_STRING`
  if [ ! -z "$OLDPID" ]; then
    echo “$SERVICE_NAME is already running pid $OLDPID !”
    exit
  fi

  echo -n $”Starting $SERVICE_NAME: “
  /bin/su $DAEMON_USER -c “$PROGRAM &”

  RETVAL=$?
  echo
  [ $RETVAL -eq 0 ] && touch $LOCKFILE
}

stop() {
  echo -n $”Stopping $SERVICE_NAME: “
  OLDPID=`/usr/bin/pgrep -f $PROCESS_STRING`
  if [ "$OLDPID" != "" ]; then
    /bin/kill -TERM $OLDPID
  else
    /bin/echo “$SERVICE_NAME is stopped”
  fi
  echo
  /bin/rm -f $NodeManagerLockFile
  [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
}

restart() {
  stop
  sleep 10
  start
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart|force-reload|restart)
    restart
    ;;
  condrestart|try-restart)
    [ -f$LOCKFILE ] && restart
    ;;
  status)
    OLDPID=`/usr/bin/pgrep -f $PROCESS_STRING`
    if [ "$OLDPID" != "" ];then
      /bin/echo “$SERVICE_NAME is running pid:$OLDPID”
    else
      /bin/echo “$SERVICE_NAME is stopped”
    fi
    RETVAL=$?
    ;;
  *)
    echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
    exit 1
esac
exit $RETVAL

Thanks in advance!

Last edited by Scott; 02-18-2012 at 05:36 AM.. Reason: Please use code tags and indent your code
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Linux Shell Question: how to print the shell script name ?

Suppose I have a script named "sc.sh" in the script how to print out its name "sc.sh"? (3 Replies)
Discussion started by: meili100
3 Replies

2. Shell Programming and Scripting

GUI shell script for Linux

Hi, I want to write shell script file that have a GUI with multiple input box for user entry , i mean multiple input box in one dialog ( window) not one window for each entry , i tried kdialog , and zenity , i didnt find a way to have multiple input box in one window with zenity and kdialog.... (0 Replies)
Discussion started by: mr_aliagha
0 Replies

3. Shell Programming and Scripting

help with linux shell script

HI im a novice with shell scripts but i need help with a random script I have this folder filled with 500 different file names... I need help creating a script that will take each filename and make a new folder named that filename and then move that file into the newly created folder. Then the... (1 Reply)
Discussion started by: emachala
1 Replies

4. Shell Programming and Scripting

Linux Shell Script

I'm interested in writing a (hopefully) simple Linux Shell Script. Upon shutdown of the system (or upon reboot), I would like the script to automatically reset any changes made during that session. This includes files saved to the hard disk as well as any configuration changes. I would also like... (6 Replies)
Discussion started by: wilson735
6 Replies

5. Shell Programming and Scripting

Shell Script for ping, Linux

I woul like to create a script in order to make a ping to a server and save in a variable a 1 if respond or a 0 if it doesnt. Then with that I could make a graffic of the server, for how long it is up.:b: So far I have this: if ; then #if the ip respond the ping shows online echo... (3 Replies)
Discussion started by: jsebastiang0
3 Replies

6. Shell Programming and Scripting

PLEASE HELP! LINUX BASH SHELL SCRIPT

PLEASE HELP! NEED LINUX SCTIPT Need to write a bash shell script to show information of employees of a department from a company data set. The script should accept a project number (1/2/3/10/20/30) and output * the name of the project * the name of the manager of the controlling... (1 Reply)
Discussion started by: help123
1 Replies

7. Homework & Coursework Questions

LINUX Bash Shell Script

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a bash shell script that presents work information of employees of a department from a company data... (1 Reply)
Discussion started by: help123
1 Replies

8. Homework & Coursework Questions

Linux Shell Script

Hi Guys I am new to Linux Shell Scripting . Can any one help me with this Task...files are attached for reference Task 1: write a script to generate a large size report file MX0002_new.XML by using the template MX0001_new.XML. Shell script is recomended, and it can run on Linux without... (2 Replies)
Discussion started by: samy_1811
2 Replies

9. Shell Programming and Scripting

Script Shell Linux

Hello, Please, how can I complete this script: Thank you (2 Replies)
Discussion started by: chercheur857
2 Replies

10. UNIX for Dummies Questions & Answers

Need some Help please with Linux shell script.

we need help with the syntax with this shell script, if you could create this shell script we can donate to a charity etc. we need to set up a directory called user3 inside directory user3 we need to create the following files : afile, anyfile, anotherfile, afiletest, bfile. bfiletest, cfile,... (3 Replies)
Discussion started by: cometboy
3 Replies
gdm-restart(1m)                                                    User Commands                                                   gdm-restart(1m)

NAME
gdm-restart, gdm-safe-restart, gdm-stop - stop or restart GDM SYNOPSIS
gdm-restart gdm-safe-restart gdm-stop DESCRIPTION
gdm-restart stops and restarts GDM by sending a HUP signal to the GDM daemon. This command immediately terminates all sessions and logs out users currently logged in with GDM. gdm-safe-restart stops and restarts GDM by sending a USR1 signal to the GDM daemon. GDM is restarted as soon as all users log out. gdm-stop stops GDM by sending a TERM signal to the GDM daemon. FILES
The following files are used by this application: /usr/bin/gdm-restart Executable to stop and restart GDM /usr/bin/gdm-safe-restarExecutable to stop and restart GDM safely /usr/bin/stop Executable to stop GDM ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-display-mgr | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
Latest version of the GNOME Desktop User Guide for your platform. gdm(1), gdmXnestchooser(1), gdmflexiserver(1), gdmphotosetup(1), gdmsetup(1), gdmthemetester(1), gdmconfig(1m) NOTES
Written by Brian Cameron, Sun Microsystems Inc., 2004. SunOS 5.10 1 Sep 2004 gdm-restart(1m)
All times are GMT -4. The time now is 03:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy