-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathset-systemd.sh
50 lines (41 loc) · 1 KB
/
set-systemd.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# By Wildy Sheverando
# Git: https://github.com/wildy8283/GPT-Bot
# ==================================================
export pyt3=$(which python3)
export NJSPATH=$(which node)
export MAIN_PATH=$(pwd)
echo "[Unit]
Description=GPT-API
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=${MAIN_PATH}
ExecStart=${pyt3} ${MAIN_PATH}/Server/server.py
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target" > /etc/systemd/system/gpt-api.service
# >> Restarting service
systemctl daemon-reload
systemctl stop gpt-api
systemctl enable gpt-api
systemctl restart gpt-api
echo "[Unit]
Description=GPT-Bot | WhatsApp
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=${MAIN_PATH}
ExecStart=${NJSPATH} ${MAIN_PATH}/WhatsApp/index.js
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target" > /etc/systemd/system/gpt-bot-wa.service
# >> Restarting service
systemctl daemon-reload
systemctl stop gpt-bot-wa
systemctl enable gpt-bot-wa
systemctl restart gpt-bot-wa