Last active
March 29, 2025 11:19
-
-
Save joaocgreis/1d77a9a5d45184a11430293f31af9d98 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# curl -L 'https://gist.githubusercontent.com/joaocgreis/1d77a9a5d45184a11430293f31af9d98/raw/rc.local' -o /etc/rc.local | |
# sudo chmod 755 /etc/rc.local | |
# sudo chown root:root /etc/rc.local | |
sleep 8 | |
export DEBIAN_FRONTEND=noninteractive | |
ping -4 -c 1 -w 1 www.google.com && (for try in `seq 49 -1 0`; do | |
echo && echo === APT === && | |
apt-get -y update && | |
apt-get -d -y dist-upgrade && | |
apt-get -y dist-upgrade && | |
apt-get -y autoremove && | |
apt-get -y clean && | |
echo && echo === SNAP === && | |
snap refresh && | |
echo && echo === DONE === && | |
echo && break | |
ps aux | grep -i -e python -e unattended -e dpkg -e apt | |
echo === $try retries left... | |
sleep 1 | |
done) || true | |
[ -e /var/run/reboot-required ] && reboot || echo === No reboot needed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment