-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathservice.sh
More file actions
executable file
·58 lines (45 loc) · 919 Bytes
/
Copy pathservice.sh
File metadata and controls
executable file
·58 lines (45 loc) · 919 Bytes
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
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
echo "MASSA Acheta install service unit"
sudo echo
echo -n "Generating service file... "
echo "
[Unit]
Description=MASSA Acheta
Wants=network.target
After=network.target
[Service]
Type=idle
User=$USER
WorkingDirectory=$HOME/massa_acheta
ExecStart=$HOME/massa_acheta/bin/python3 main.py
Restart=always
RestartSec=60
[Install]
WantedBy=multi-user.target
" > ./massa_acheta.service
if [[ $? -eq 0 ]]
then
echo "Done!"
else
echo "Error!"
exit 1
fi
echo -n "Copying service file to /etc/systemd/system/massa_acheta.service... "
sudo cp ./massa_acheta.service /etc/systemd/system/massa_acheta.service
if [[ $? -eq 0 ]]
then
echo "Done!"
else
echo "Error!"
exit 1
fi
echo -n "Reloading systemd daemon configuration... "
sudo systemctl daemon-reload
if [[ $? -eq 0 ]]
then
echo "Done!"
else
echo "Error!"
exit 1
fi
exit 0