add automate.sh
This commit is contained in:
parent
338cd34109
commit
85cb7c012e
1 changed files with 24 additions and 0 deletions
24
automate.sh
Normal file
24
automate.sh
Normal 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!"
|
Loading…
Add table
Reference in a new issue