Last active
January 9, 2024 11:02
-
-
Save pacharanero/7159a58a8e7334d4c3ea6a0c4aefe33f to your computer and use it in GitHub Desktop.
This file contains 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 -x | |
set -e | |
# COMMAND | |
# curl -Lks https://gist.github.com/pacharanero/7159a58a8e7334d4c3ea6a0c4aefe33f/raw | /bin/bash | |
update_ubuntu () { | |
export DEBIAN_FRONTEND=noninteractive | |
sudo apt-get update | |
sudo apt-get -y dist-upgrade | |
sudo apt-get -y autoremove | |
sudo apt-get -y autoclean | |
} | |
update_discourse () { | |
cd /var/discourse | |
# pull new code in discourse-docker | |
sudo git pull | |
# rebuild app, which updates docker-manager and discourse code itself | |
sudo ./launcher rebuild app | |
# clean up stopped containers | |
echo Y Y Y | ./launcher cleanup | |
} | |
reboot_server_if_required () { | |
if cat /var/run/reboot-required | |
then | |
echo -e "\e[31mreboot required\n\n\n\e[0m" | |
sudo reboot now | |
else | |
echo -e "\e[32mreboot not required\n\n\n\e[0m" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment