1
0
Fork 0

Confgure a systemd service for OASIS

This commit is contained in:
Benoît Rouits 2020-05-27 21:01:17 +02:00
parent c9f9873642
commit 3b714553a5
1 changed files with 20 additions and 7 deletions

View File

@ -92,11 +92,24 @@ scuttlebutt() {
}
EOF
cat > ~/.zen/launch-oasis.sh <<EOF
#!/bin/bash
oasis --allow-host $nodename --host $nodename
echo "CREATE SYSTEMD oasis SERVICE >>>>>>>>>>>>>>>>>>"
cat > /tmp/oasis.service <<EOF
[Unit]
Description=OASIS Scuttlebutt Gateway
After=network.target
[Service]
User=_USER_
ExecStart=/usr/local/bin/oasis --host $nodename --allow-host $nodename
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
sudo cp -f /tmp/oasis.service /etc/systemd/system/
sudo sed -i "s/_USER_/$USER/g" /etc/systemd/system/oasis.service
echo "
_ __ __ _
_ _ .__|_o _ (_ (_ |_)
@ -112,13 +125,13 @@ __)|_| \ \/ |_| \ || || |_ ... SCUTTLEBUTT ... OK?
'
echo "Launching oasis"
oasis --allow-host $nodename --host $nodename &
sudo systemctl daemon-reload || err "Restart OASIS"
sudo systemctl enable oasis || err "Enable OASIS daemon"
echo " http://$nodename:3000 "
echo
echo "ADD ~/.zen/launch-oasis.sh TO YOUR '/etc/rc.local' !!! Or use patchwork. "
sleep $((1 + RANDOM % 5))
echo "LAUNCHING OASIS NODE MANAGER http://$nodename:3000"
echo "IF YOU ARE A PUB consider protect it behind password nginx redirect !!!"
echo "3 seconds before ssb_INIT.sh..."