This commit is contained in:
Gogs
2020-05-10 18:29:14 +04:00
parent 7f4e11b073
commit 6a2cd57e6e
17 changed files with 297 additions and 60 deletions

25
shell/2-InstallService.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
./Prepare.sh
cd ..
ServiceName=$(python3 Scripts.py --getconfig PROGNAME)
SHMName=$(python3 Scripts.py --getconfig SHMNAME)
echo '[Unit]
Description=Запуск '$ServiceName'
[Service]
ExecStart='$PWD'/shell/Gunicorn.sh
User='$USER'
Group='$USER'
[Install]
WantedBy=multi-user.target
' > /tmp/site_$SHMName.service
#echo "Устанавливаем сервис для пользователя $FNAME"
sudo cp /tmp/site_$SHMName.service /etc/systemd/system/site_$SHMName.service
sudo systemctl enable site_$SHMName.service
sudo systemctl restart site_$SHMName.service