-
Notifications
You must be signed in to change notification settings - Fork 16
/
service_installer.sh
executable file
·108 lines (78 loc) · 1.9 KB
/
service_installer.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash
#will make the services for the pool, based on the pool exe location of /usr/local/bin/poolbin
user="perklepool"
coin="prkl"
config_dir="/home/$user/open-perkle-pool/configs"
poolbinary="/home/$user/open-perkle-pool/build/bin/open-perkle-pool"
if [ ! -e $config_dir ] || [ ! -e $poolbinary ]
then
echo missing config dir or pool binary, exiting
exit 1
fi
echo "
[Unit]
Description=$coin-api
[Service]
Type=simple
ExecStart=$poolbinary $config_dir/api.json
[Install]
WantedBy=multi-user.target
">/etc/systemd/system/$coin-api.service
echo "
[Unit]
Description=$coin-stratum2b
[Service]
Type=simple
ExecStart=$poolbinary $config_dir/stratum2b.json
[Install]
WantedBy=multi-user.target
">/etc/systemd/system/$coin-stratum2b.service
echo "
[Unit]
Description=$coin-stratum4b
[Service]
Type=simple
ExecStart=$poolbinary $config_dir/stratum4b.json
[Install]
WantedBy=multi-user.target
">/etc/systemd/system/$coin-stratum4b.service
echo "
[Unit]
Description=$coin-stratum9b
[Service]
Type=simple
ExecStart=$poolbinary $config_dir/stratum9b.json
[Install]
WantedBy=multi-user.target
">/etc/systemd/system/$coin-stratum9b.service
echo "
[Unit]
Description=$coin-unlocker
[Service]
Type=simple
ExecStart=$poolbinary $config_dir/unlocker.json
[Install]
WantedBy=multi-user.target
">/etc/systemd/system/$coin-unlocker.service
echo "
[Unit]
Description=$coin-payout
[Service]
Type=simple
ExecStart=$poolbinary $config_dir/payout.json
[Install]
WantedBy=multi-user.target
">/etc/systemd/system/$coin-payout.service
systemctl daemon-reload
systemctl enable $coin-api
systemctl enable $coin-stratum2b
systemctl enable $coin-stratum4b
systemctl enable $coin-stratum9b
#systemctl enable $coin-unlocker
#systemctl enable $coin-payout
systemctl start $coin-api
systemctl start $coin-stratum2b
systemctl start $coin-stratum4b
systemctl start $coin-stratum9b
#systemctl start $coin-unlocker
#systemctl start $coin-payout