Last active
February 4, 2021 13:37
-
-
Save pandanote-info/8b5de172f81542ac8e4e424e5d6231aa to your computer and use it in GitHub Desktop.
GROWIの起動・終了を実行するとともに、その際に稼働状況をリモートのMariaDBに作成したテーブルに書き込むためのshell script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# See https://pandanote.info/?p=7259 for details. | |
# | |
MODE="start" | |
SERVER="192.168.11.11" | |
if [ -n "$1" ]; then | |
MODE="stop" | |
fi | |
if [ ${MODE} != "stop" ]; then | |
mysql -h ${SERVER} -u serverstatus -p'Some password to store the status of the remote server.' -e "insert into serverstatus(status) value(1)" serverstatus | |
cd /opt/wiki/growi | |
npm run server:prod | |
else | |
mysql -h ${SERVER} -u serverstatus -p'Some password to store the status of the remote server.' -e "insert into serverstatus(status) value(0)" serverstatus | |
pkill --signal SIGINT node | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment