aboutsummaryrefslogtreecommitdiffstats
path: root/bin/srt
diff options
context:
space:
mode:
Diffstat (limited to 'bin/srt')
-rwxr-xr-xbin/srt32
1 files changed, 32 insertions, 0 deletions
diff --git a/bin/srt b/bin/srt
index 41753b74..721f1224 100755
--- a/bin/srt
+++ b/bin/srt
@@ -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 )