MadJoker0815 / roborock_nologs

No reboots at 3am and no logfiles that fill up the disk and checks to keep filesystem healthy
25 stars 1 forks source link

I have a few bots so create script to apply your patches #1

Closed s3frank closed 4 years ago

s3frank commented 4 years ago
#!/bin/bash
##
# Stop Cron service and Watchdog
echo "Stopping Cron and Watchdog services..."
service rrwatchdoge stop
service cron stop 

# Copy all the files and overwrite
echo "Copying patched files into place..."
yes | cp -rf patch/. /.

# Make sure things are executable
echo "Setting execution flag on scripts..."
chmod +x /opt/rockrobo/rrlog/logclean.sh
chmod +x /root/check_all
chmod +x /root/check_reboot
chmod +x /usr/bin/logrotate.sh

# Restart all services, sleep for 2 minutes and then issue a reboot
echo "Starting Cron and Watchdog again..."
service cron start
sleep 10 
service rrwatchdoge start

echo "Rebooting in 30 seconds..."
sleep 30
reboot

This assumes that all the files you currently have in your repo end up in sub directory called patch and the script (apply_patch.sh in my case) is executed in the working directory.

MadJoker0815 commented 4 years ago

I'm thinking about a install script doing all work. I think is this would be the easiest way.

MadJoker0815 commented 4 years ago

I added a install.sh script, this should be able to make the modifications. Just load this onto the system and execute it via "sh install.sh" It does not matter where the script is located.

https://github.com/MadJoker0815/roborock_nologs/blob/master/install.sh

s3frank commented 4 years ago

Awesome

-FF

Sent from my mobile, powered by Frank's thumbs!

On Fri, Jan 24, 2020, 18:58 MadJoker0815 notifications@github.com wrote:

Closed #1 https://github.com/MadJoker0815/roborock_nologs/issues/1.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MadJoker0815/roborock_nologs/issues/1?email_source=notifications&email_token=AAQW7CRFVV2TVE5VGHAHOPDQ7LCWNA5CNFSM4KFSOZVKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOWFXP5QA#event-2976841408, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQW7CRYKCD2IVPYVNJIGGLQ7LCWNANCNFSM4KFSOZVA .