Sponsored Content
Top Forums Shell Programming and Scripting Assistiance in small bash script Post 302834969 by Scrutinizer on Sunday 21st of July 2013 04:12:48 AM
Old 07-21-2013
You need something like:
Code:
if [ "$($SERVICE status)" =  "some status string" ])
then

to compare the textual status output of the xinetd stop/start script...

If the xinetd stop / start script outputs a return code; you could try something like:
Code:
if ! $SERVICE status > /dev/null 2>&1
then

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help in a small script

Hi all, I have a file of the following format - EXPRPT:SCN:1.1706E+10:SEQ_START:121652:SEQ_END:121664:0 ( This file name is variable and changes daily) Now in the same directory I have another set of files of the format - EXPRPT.log.0001.0000121669 Now what I am trying to do is to ... (2 Replies)
Discussion started by: super_duper_guy
2 Replies

2. Shell Programming and Scripting

small script help

here is a small script: if ; then echo please enter an argument fi if [ "$1" = "tom"; then a=$1 echo $a fi here is my question. if the script name is j.sh and I run it : j.sh from shell prompt: without a parameter: it prints please enter an argument but if I go with . j.sh (current... (1 Reply)
Discussion started by: rkl1
1 Replies

3. Shell Programming and Scripting

bash script working for small size files but not for big size files.

Hi, I have one file stat. Stat file contents are as follows: for example. H50768020040913,00260100,507680,13,0000000643,0000000643,00000,0000 H50769520040808,00260100,507695,13,0000000000,0000000000,00000,0000 H50770620040611,00260100,507706,13,0000000000,0000000000,00000,0000 Now i... (1 Reply)
Discussion started by: davidpreml
1 Replies

4. Shell Programming and Scripting

small script

Hi, I am new to unix shell scripting. I just want a little script to check the no. of processes are equal to 8, then echo a successful message otherwise echo a unsuccessful message. Please help. Thanks. (3 Replies)
Discussion started by: everurs789
3 Replies

5. Shell Programming and Scripting

A small project with bash script and craigslist

Before I start, I'm posting this for community knowledge, not to offend anyone. I thought it was an interesting project so that's why I'm sharing it. In the notorious erotic classified ads of craigslist, thousands of individuals post classifieds, using the internet to sell themselves with an... (0 Replies)
Discussion started by: hexpill
0 Replies

6. Shell Programming and Scripting

need a small script

Hello all, i have a batmail process running on my machine(java process). i just need a script we should detect whether the batchnail is running or not.If not it should restart it. Can anyone assist me on this? (1 Reply)
Discussion started by: Rayzone
1 Replies

7. AIX

Need help in a small script

Hello all, could somebody help..? I have following 6 files (with white spaces in their names) This is file This is file1 This is file2 This is file3 This is file4 This is file5 This is file6 I tried to run the below script, and it did not give me desired ouput.. $ for i in `ls -1` >... (7 Replies)
Discussion started by: gsabarinath
7 Replies

8. UNIX for Dummies Questions & Answers

need help with small script

Hi I have the below file Name=abc Yr=2011 Mon=05 My script should be in such a way that whenever I run it then Month should increment by 1 and if the month is 12 then when I run the script then year should incremented by 1 and month Should become 01(I.e jan) Thanks for the help in... (6 Replies)
Discussion started by: kishu
6 Replies

9. Shell Programming and Scripting

Making a bash script and small C program for a homework assignment

Here's the assignment. I'll bold the parts that are rough for me. Unfortunately, that's quite a bit lol. The syntax is, of course, where my issues lie, for the most part. I don't have a lot of programming experience at all :/. I'd post what I've already done, but I'm so lost I really don't know... (1 Reply)
Discussion started by: twk101
1 Replies

10. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies
cmrunserv(1m)															     cmrunserv(1m)

NAME
cmrunserv - run a service from the high availability package run script SYNOPSIS
cmrunserv [-v] service_name service_command_string cmrunserv [-v] [-r restarts] service_name service_command_string cmrunserv [-v] [-R] service_name service_command_string DESCRIPTION
cmrunserv is used in the high availability package run script to run a service. To start package's service, a user must either be superuser(UID=0), or have an access policy of FULL_ADMIN allowed in the cluster configu- ration file. See access policy in cmquerycl(1m) or cmmakepkg(1m). If the service process dies, cmrunserv updates the status of the service to down. The cluster software will recognize the change in status and execute the normal package recovery sequence. This includes executing the package halt script, determining if the package can be run on a different node, and, if so, executing the package run script on the new node. Should the service_command be halted by the cmhaltserv command, a SIGTERM signal will be sent to the process. This executable or shell script should be able to handle a SIGTERM signal and execute a graceful shutdown performing any cleanup necessary. If the process ignores the SIGTERM, a SIGKILL will be sent to the process. If a SIGKILL is sent, the process will die immediately and will be unable to perform any cleanup. Options cmrunserv supports the following options. -v Verbose output will be displayed. -r restarts Indicates that the service should be automatically restarted by the cluster software if it fails, without halting the package. restarts indicates how many times the service may fail before the package should be halted. -R Indicates the service should be restarted an unlimited number of times if it fails. service_name Name of the service as it exists in the package configuration information. service_command_string Process string to be started. This includes the process name and any arguments necessary for the process to run. The process name must be a full path, may be either a command name or a shell script, and must be executable. RETURN VALUE
cmrunserv returns the following values: 0 Successful completion. 1 Command failed. EXAMPLES
To run the service command string /var/opt/db/database1 under the service name db1, do the following: # Run the process /var/opt/db/database1 cmrunserv db1 /var/opt/db/database1 This line should only be executed within a package run script. AUTHOR
cmrunserv was developed by HP. SEE ALSO
cmhaltserv(1m), cmquerycl(1m), cmmakepkg(1m), cmmodnet(1m). Requires Optional Serviceguard Software cmrunserv(1m)
All times are GMT -4. The time now is 06:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy