D
D
dbmaster2012-03-03 05:54:45
bash
dbmaster, 2012-03-03 05:54:45

Need constructive criticism bash script

Good afternoon,

We have been working with Linux not so long ago, so I ask you to look at the script for starting / stopping the service.

The script itself is here - pastebin.com/NgdPgQLx

Thank you very much!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Sundukov, 2012-03-03
@alekciy

I'd

SCRIPTNAME=/etc/init.d/$NAME

replaced by
SCRIPTNAME=`readlink -m $0`

Because if you change the NAME, but do not change the file name, you can get an error when using the SCRIPTNAME variable. Now, in reality, it does not contain the data embedded in the meaning of the name.

Y
Yuri Syrovetsky, 2012-03-03
@cblp

Try upstart if your system has it (i.e. if you have Ubuntu). Everything is much simpler there, for example, you do not need to write all this triviality that occurs in every first script from SystemV.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question