summarylogtreecommitdiffstats
path: root/run.sh
diff options
context:
space:
mode:
authorfrnmst/Franco Masotti2016-11-15 17:22:28 +0100
committerfrnmst/Franco Masotti2016-11-15 17:22:28 +0100
commit1b5383bde976a320adfe01dc456a93ca68edfd7b (patch)
tree1528c1cdf00aa26db860a55ea995db595e4dc5d9 /run.sh
parenteb0a4126d3f407079a2d2d15725b99f053a6e8c1 (diff)
downloadaur-1b5383bde976a320adfe01dc456a93ca68edfd7b.tar.gz
Lots of fixes.
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh25
1 files changed, 7 insertions, 18 deletions
diff --git a/run.sh b/run.sh
index 7a446416fff5..cdabef6b9cd6 100755
--- a/run.sh
+++ b/run.sh
@@ -70,7 +70,7 @@ startd()
exec swipl --quiet -f "$pkg_dir"/run.pl
) &
pid="$!"
- } 1>/dev/null 2>/dev/null
+ }
write_pid_file "$pid"
}
@@ -123,26 +123,15 @@ write_pid_file()
fi
}
-killd()
-{
- # kill action only if process exists.
- if [ -f "$pid_file" ]; then
- pid=$(cat "$pid_file")
- ps -q $pid > /dev/null
- if [ $? -eq 0 ]; then
- kill -s TERM $pid
- fi
- fi
-}
-
option_parser()
{
- getopts ":hks" opt "$@"
+ getopts ":hiks" opt "$@"
case "$opt" in
- h) help ;;
- k) killd ;;
- s) startd ;;
- ?) help; return 1 ;;
+ h ) help ;;
+ i ) init ;;
+ k ) killd ;;
+ s ) startd ;;
+ ? ) help; return 1 ;;
esac
}