diff options
-rwxr-xr-x | bin/acme/patcher/inplace/bin/srt | 23 | ||||
-rwxr-xr-x | bin/srt | 32 |
2 files changed, 55 insertions, 0 deletions
diff --git a/bin/acme/patcher/inplace/bin/srt b/bin/acme/patcher/inplace/bin/srt index af8a1fb2..5eba94d6 100755 --- a/bin/acme/patcher/inplace/bin/srt +++ b/bin/acme/patcher/inplace/bin/srt @@ -175,6 +175,28 @@ verify_prereq() { return 0 } +create_restart() { + cat > $SRT_BASE_DIR/bin/srt_start.sh << endmsg +#!/bin/bash +# Restart the SRTool using the last start options +if [ -f $SRT_BASE_DIR/.srtmain.pid ] ; then + $SRT_BASE_DIR/bin/srt_stop.sh +fi +$SRT_BASE_DIR/bin/srt $* +endmsg + chmod +x $SRT_BASE_DIR/bin/srt_start.sh + cat > $SRT_BASE_DIR/bin/srt_stop.sh << endmsg +#!/bin/bash +# Stop the SRTool based on the the last start options +if [ 1 -eq $no_auto_update ] ; then + $SRT_BASE_DIR/bin/srt stop noautoupdate +else + $SRT_BASE_DIR/bin/srt stop +fi +endmsg + chmod +x $SRT_BASE_DIR/bin/srt_stop.sh +} + # read command line parameters if [ -n "$BASH_SOURCE" ] ; then SRT=${BASH_SOURCE} @@ -297,6 +319,7 @@ case $CMD in # set fail safe stop system on terminal exit trap stop_system SIGHUP echo "Successful ${CMD}." + create_restart $* exit 0 ;; stop ) @@ -170,6 +170,37 @@ verify_prereq() { return 0 } +create_restart() { + cat > $SRT_BASE_DIR/bin/srt_start.sh << endmsg +#!/bin/bash +# Restart the SRTool using the last start options +if [ -f $SRT_BASE_DIR/.srtmain.pid ] ; then + $SRT_BASE_DIR/bin/srt_stop.sh +fi +$SRT_BASE_DIR/bin/srt $* +endmsg + chmod +x $SRT_BASE_DIR/bin/srt_start.sh + cat > $SRT_BASE_DIR/bin/srt_stop.sh << endmsg +#!/bin/bash +# Stop the SRTool based on the the last start options +if [ 1 -eq $no_auto_update ] ; then + $SRT_BASE_DIR/bin/srt stop noautoupdate +else + $SRT_BASE_DIR/bin/srt stop +fi +endmsg + chmod +x $SRT_BASE_DIR/bin/srt_stop.sh +} + +# read command line parameters +if [ -n "$BASH_SOURCE" ] ; then + SRT=${BASH_SOURCE} +elif [ -n "$ZSH_NAME" ] ; then + SRT=${(%):-%x} +else + SRT=$0 +fi + # read command line parameters if [ -n "$BASH_SOURCE" ] ; then SRT=${BASH_SOURCE} @@ -282,6 +313,7 @@ case $CMD in # set fail safe stop system on terminal exit trap stop_system SIGHUP echo "Successful ${CMD}." + create_restart $* exit 0 ;; stop ) |