Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Upgrade Brew if on OS X or apt-get otherwise. If parameter is received, upgrade a remote (Ubuntu) machine
if [ -z $1 ]
then
if [ "$OS" == "Darwin" ]
then
echo "Updating…"
brew update
echo "Upgrading…"
brew upgrade
else
sudo apt-get update
sudo apt-get -u upgrade
fi
else
ssh $1 -t sudo apt-get update
local dummy
ssh $1 -t sudo apt-get --no-act upgrade
echo -n "Process the upgrade ?"
read -q dummy
if [[ $dummy = "y" ]]
then
ssh $1 -t sudo apt-get -u upgrade --yes
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.