Compare commits

..

No commits in common. "ff960c210ed4fb2b4907d142d819600fdfdc753f" and "c7e4baee7ed3781c303389609a04c3b7f1b45e4e" have entirely different histories.

2 changed files with 0 additions and 92 deletions

View File

@ -1,23 +0,0 @@
#!/bin/bash
cmd_cat="/bin/cat"
cmd_rm="/bin/rm"
cmd_tr="/usr/bin/tr"
formatingFiles() {
for file in $(ls); do
formatFile $file
done
}
# Formating ASCII file to remove '\r' characters comming from Windows
formatFile() {
local file=$1
local tmp=$file.tmp
$cmd_tr -d '\r' < $file > $tmp
$cmd_cat $tmp > $file
$cmd_rm $tmp
}
formatingFiles

View File

@ -1,69 +0,0 @@
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: scriptName
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $portmap
# Should-Stop: $portmap
# X-Start-Before: nis
# X-Stop-After: nis
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: Short description of the script
# Description: description of the script
# a big one :)
### END INIT INFO
#######################
name="kage"
dirPath="/path/to/app"
#######################
sh="/bin/bash"
pidPath="$dirPath/$name.pid"
#######################
do_start() {
# TODO do start app
/bin/echo $! > $pidPath
}
do_stop() {
if [ -e $pidPath ]
then
pid=$(/bin/cat $pidPath)
kill $pid
rm $pidPath
fi
}
get_status() {
if [ -e $pidPath ] ; then
pid=$(/bin/cat $pidPath) ;
/bin/echo "$name is running with PID $pid" ;
else
/bin/echo "$name is stopped" ;
fi
}
case $1 in
start)
do_start
;;
stop)
do_stop
;;
restart)
do_stop
do_start
;;
status)
get_status
;;
*)
/bin/echo "Usage: $0 {start|stop|restart|status}"
exit 2
;;
esac