diff options
author | frnmst/Franco Masotti | 2016-11-15 17:22:28 +0100 |
---|---|---|
committer | frnmst/Franco Masotti | 2016-11-15 17:22:28 +0100 |
commit | 1b5383bde976a320adfe01dc456a93ca68edfd7b (patch) | |
tree | 1528c1cdf00aa26db860a55ea995db595e4dc5d9 /run.sh | |
parent | eb0a4126d3f407079a2d2d15725b99f053a6e8c1 (diff) | |
download | aur-1b5383bde976a320adfe01dc456a93ca68edfd7b.tar.gz |
Lots of fixes.
Diffstat (limited to 'run.sh')
-rwxr-xr-x | run.sh | 25 |
1 files changed, 7 insertions, 18 deletions
@@ -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 } |