fix SOS
This commit is contained in:
33
archiso/airootfs/home/smart/smart-organizer-service-install.sh
Executable file → Normal file
33
archiso/airootfs/home/smart/smart-organizer-service-install.sh
Executable file → Normal file
@@ -4,8 +4,9 @@ SOFT_PATH="/home/smart"
|
|||||||
SOFT_NAME="SmartOrganizer"
|
SOFT_NAME="SmartOrganizer"
|
||||||
SERVICE_SCRIPT="SOService"
|
SERVICE_SCRIPT="SOService"
|
||||||
SERVICE_NAME="SOS"
|
SERVICE_NAME="SOS"
|
||||||
|
#https://bbt-static-beta.oss-cn-beijing.aliyuncs.com/smart/organizer/SmartOrganizer.zip
|
||||||
wget -q --no-check-certificate "https://bbt-static-a.oss-cn-beijing.aliyuncs.com/smart/organizer/${SOFT_NAME}.zip" -O ${SOFT_PATH}/${SOFT_NAME}.zip
|
wget -q --no-check-certificate "https://bbt-static-beta.oss-cn-beijing.aliyuncs.com/smart/organizer/SmartOrganizer.zip" -O ${SOFT_PATH}/${SOFT_NAME}.zip
|
||||||
|
cp -r -f /home/smart/install8.5/SmartOrganizer /home/smart/
|
||||||
|
|
||||||
if [[ -z ${SOFT_PATH}/${SOFT_NAME}.zip ]]; then
|
if [[ -z ${SOFT_PATH}/${SOFT_NAME}.zip ]]; then
|
||||||
echo "Download failed!"
|
echo "Download failed!"
|
||||||
@@ -67,9 +68,27 @@ if [[ $(getSystemVersion) -eq 6 ]]; then
|
|||||||
service SOS start
|
service SOS start
|
||||||
else
|
else
|
||||||
echo "current system version is > 6"
|
echo "current system version is > 6"
|
||||||
systemctl stop ${SERVICE_NAME}
|
systemctl stop ${SERVICE_SCRIPT}
|
||||||
systemctl disable ${SERVICE_NAME}
|
systemctl disable ${SERVICE_SCRIPT}
|
||||||
rm -f /usr/lib/systemd/system/${SERVICE_NAME}.service
|
rm -f /usr/lib/systemd/system/${SERVICE_SCRIPT}.service
|
||||||
systemctl enable ${SERVICE_NAME}
|
|
||||||
systemctl start ${SERVICE_NAME}
|
cat > /usr/lib/systemd/system/${SERVICE_SCRIPT}.service <<EOF
|
||||||
|
[Unit]
|
||||||
|
Description=SOService
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5s
|
||||||
|
ExecStart=/bin/bash /home/smart/SmartOrganizer/SOService start
|
||||||
|
ExecStop=/bin/bash /home/smart/SmartOrganizer/SOService stop
|
||||||
|
ExecRestart=/bin/bash /home/smart/SmartOrganizer/SOService restart
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
systemctl daemon-reload
|
||||||
|
|
||||||
|
systemctl enable ${SERVICE_SCRIPT}
|
||||||
|
systemctl start ${SERVICE_SCRIPT}
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user