add automate.sh

This commit is contained in:
ida schmidt 2020-03-31 21:45:53 -07:00
parent 338cd34109
commit 85cb7c012e

24
automate.sh Normal file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
echo "preparing..." # making sure things are clean and have the right owners
chmod 755 systemd/mc-backup
chown minecraftuser:minecraftuser systemd/mc-backup
chown root:root systemd/{*.timer,*.service}
echo "copying..." # move those files haha
cp systemd/{*.timer,*.service} /etc/systemd/system/
# dont like how this feels but i dont wanna change the permissions on this folder if it exists already
su minecraftuser -c "
mkdir -p /home/minecraftuser/.local/bin/
cp systemd/mc-backup /home/minecraftuser/.local/bin/
"
echo "loading units..."
systemctl daemon-reload
echo "enabling units..."
systemctl enable mc-backup.service mc-backup.timer mc-server.service
echo "starting units..."
systemctl start mc-backup.service mc-backup.timer mc-server.service
echo "done!"