From a371c0f6b2d994a074eaeb56a2125cb4c0af85f8 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Fri, 22 Jun 2018 14:04:09 +0800 Subject: [PATCH] Add install file --- install.sh | 20 ++++++++++++++++++++ mqtt-daemon.py => suanzi-support | 0 suanzi-support.service | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100755 install.sh rename mqtt-daemon.py => suanzi-support (100%) mode change 100644 => 100755 diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..acbf196 --- /dev/null +++ b/install.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +SERVICE='suanzi-support.service' + + +echo 'Install suanzi-support' +cp suanzi-support /usr/local/bin/ || exit 1 + +echo "Install ${SERVICE}" + +cp ${SERVICE} /lib/systemd/system || exit 1 +systemctl enable ${SERVICE} || exit 1 + +echo "Start ${SERVICE}" +systemctl start ${SERVICE} || exit 1 + +echo "Done" + + + diff --git a/mqtt-daemon.py b/suanzi-support old mode 100644 new mode 100755 similarity index 100% rename from mqtt-daemon.py rename to suanzi-support diff --git a/suanzi-support.service b/suanzi-support.service index 16531f3..87f0081 100644 --- a/suanzi-support.service +++ b/suanzi-support.service @@ -5,7 +5,7 @@ After=network-online.target [Service] User=debian Type=simple -ExecStart=/usr/local/bin/autossh-wrapper.py -u 'autossh' autossh.suanzi.ai +ExecStart=/usr/local/bin/suanzi-support ExecStop=/usr/bin/pkill -P $MAINPID KillMode=process Restart=always -- 2.11.0