Email notifications and one click install for Ubuntu package updates. http://stephennancekivell.blogspot.com/2013/06/server-updates-automate-it-part-2.html
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 | |
MSG=`sudo apt-get --yes dist-upgrade` | |
MSG_HEADING='sudo apt-get --yes dist-upgrade' | |
GmailSend.py -u bla@gmail.com -p bla -t bla@gmail.com -s "server update" -b "$MSG_HEADING \n\n $MSG" |
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 | |
sudo apt-get update > /dev/null | |
M=`sudo apt-get --download-only --yes dist-upgrade` | |
MSG_HEADING='sudo apt-get --download-only --yes dist-upgrade' | |
LINK='http://myserver.com/bla/doTheUpgrade/dontGuessMe' | |
if echo $M | grep 'The following packages will be upgraded' > /dev/null | |
then | |
# these is upgrade | |
GmailSend.py -u bla@gmail.com -p bla -t bla@gmail.com -s "server update" -b "$MSG_HEADING \n\n $M \n\n $LINK" | |
fi |
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
#!/usr/bin/env python | |
from flask import Flask | |
import os | |
app = Flask(__name__) | |
@app.route("/doTheUpgrade/dontGuessMe") | |
def hello(): | |
os.system("sh ./do_update.sh") | |
return "performing update" | |
if __name__ == "__main__": | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment