File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed File renamed without changes.
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+ echo " Script is stopping the node..."
4
+
5
+ # Stop the node
6
+ cd /home/bcuser/node
7
+ /usr/local/bin/docker-compose -f /home/bcuser/node/docker-compose.yml down
8
+
9
+ echo " Stopped"
Original file line number Diff line number Diff line change @@ -226,8 +226,9 @@ crontab -l
226
226
227
227
echo " Configuring node as a service"
228
228
mkdir /home/bcuser/bin
229
- mv /opt/base/node.sh /home/bcuser/bin/node.sh
230
- chmod 766 /home/bcuser/bin/node.sh
229
+ mv /opt/base/node-start.sh /home/bcuser/bin/node-start.sh
230
+ mv /opt/base/node-stop.sh /home/bcuser/bin/node-stop.sh
231
+ chmod 766 /home/bcuser/bin/*
231
232
chown -R bcuser:bcuser /home/bcuser
232
233
233
234
sudo bash -c ' cat > /etc/systemd/system/base.service <<EOF
@@ -240,7 +241,8 @@ Restart=always
240
241
RestartSec=30
241
242
User=bcuser
242
243
Environment="PATH=/bin:/usr/bin:/home/bcuser/bin"
243
- ExecStart=/home/bcuser/bin/node.sh
244
+ ExecStart=/home/bcuser/bin/node-start.sh
245
+ ExecStop=/home/bcuser/bin/node-stop.sh
244
246
[Install]
245
247
WantedBy=multi-user.target
246
248
EOF'
You can’t perform that action at this time.
0 commit comments