Skip to content

Instantly share code, notes, and snippets.

@danielfilho
Forked from dserodio/upgrade.sh
Last active August 29, 2015 14:14
Show Gist options
  • Save danielfilho/3522b28f4d57fdccd516 to your computer and use it in GitHub Desktop.
Save danielfilho/3522b28f4d57fdccd516 to your computer and use it in GitHub Desktop.
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