mirror of
https://github.com/troglobit/finit.git
synced 2026-10-09 16:50:59 +07:00
test: whitespace changes only
Coding style for shell scripts: - Tabs for indent (change in Emacs needed) - Braces on their own line, like C functions Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -4,31 +4,38 @@
|
||||
DAEMON="/test_assets/service.sh"
|
||||
PIDFILE="/var/run/service.pid"
|
||||
|
||||
start() {
|
||||
start()
|
||||
{
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
start-stop-daemon -S -b -q -p "$PIDFILE" -x "$DAEMON"
|
||||
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
|
||||
return "$status"
|
||||
}
|
||||
|
||||
stop() {
|
||||
stop()
|
||||
{
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
start-stop-daemon -K -q -p "$PIDFILE"
|
||||
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
|
||||
return "$status"
|
||||
}
|
||||
|
||||
restart() {
|
||||
restart()
|
||||
{
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
@@ -36,7 +43,8 @@ restart() {
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
"$1";;
|
||||
"$1"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}, got $0 $1"
|
||||
exit 1
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
cleanup()
|
||||
{
|
||||
echo "Got signal, stopping ..."
|
||||
rm -f /run/service.pid
|
||||
exit 0
|
||||
echo "Got signal, stopping ..."
|
||||
rm -f /run/service.pid
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Hook SIGUSR1 and dump trace to file system
|
||||
@@ -20,5 +20,5 @@ echo $$ > /run/service.pid
|
||||
# sleep may exit on known signal, so
|
||||
# we cannot use 'set -e'
|
||||
while true; do
|
||||
sleep 1
|
||||
sleep 1
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user