add service setup to setupscript

This commit is contained in:
Yannik Schmidt
2021-08-31 21:52:13 +02:00
parent f27bca31a8
commit 044a7f97fe
2 changed files with 8 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ After=network.target
WorkingDirectory=/home/flask/jeffrey_miller_flask_ftp/
Type=simple
User=flask
ExecStart=/usr/bin/waitress-serve --host 127.0.0.1 --port 5014 --call 'app:createApp'
ExecStart=/usr/bin/waitress-serve --host 0.0.0.0 --port 5000 --call 'app:createApp'
[Install]
WantedBy=multi-user.target

View File

@@ -27,3 +27,10 @@ ssh -t ${TARGET} "${CMD_RESTART_FTP}"
CMD_LOCK_SSH="echo 'AllowUsers root' >> /etc/ssh/sshd_config"
ssh -t ${TARGET} "${CMD_LOCK_SSH}"
CMD_CP_SERVICE="cp /home/flask/jeffrey_miller_flask_ftp/flask-ftp.service /etc/systemd/user/"
CMD_ENABLE_SERVICE="systemctl enable /etc/systemd/user/flask-ftp.service"
CMD_START_SERVICE="systemctl start flask-ftp.service"
ssh -t ${TARGET} "${CMD_CP_SERVICE}"
ssh -t ${TARGET} "${CMD_ENABLE_SERVICE}"
ssh -t ${TARGET} "${CMD_START_SERVICE}"