Implement install and update system for the bot
- LINUX OR WINDOW WSL ONLY
This commit is contained in:
@@ -1,15 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if the user is root
|
||||
if [ "$EUID" -ne 0 ]
|
||||
then echo "Please run as root"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Sleeping to give the client time to respond to the requester
|
||||
sleep 5
|
||||
|
||||
# Stating Message
|
||||
echo "<!-- UPDATING ---!>"
|
||||
|
||||
# TODO - Add an updater for Stable Diffusion API
|
||||
|
||||
# Stop any running service
|
||||
systemctl stop RadioNode
|
||||
|
||||
# Update the git Repo
|
||||
git fetch -a -p
|
||||
git pull
|
||||
installUser=$(cat ./config/installerName)
|
||||
sudo su -l $installUser -c 'git fetch -a -p'
|
||||
sudo su -l $installUser -c 'git pull'
|
||||
|
||||
# Install any new libraries
|
||||
npm i
|
||||
|
||||
# Start the service
|
||||
systemctl start RadioNode
|
||||
|
||||
# Update complete message
|
||||
echo "<!--- UPDATE COMPLETE! ---!>"
|
||||
Reference in New Issue
Block a user