Skip to content

Instantly share code, notes, and snippets.

@ZiTAL
Last active August 29, 2015 14:08
Show Gist options
  • Save ZiTAL/e78641e956d9a28a1536 to your computer and use it in GitHub Desktop.
Save ZiTAL/e78641e956d9a28a1536 to your computer and use it in GitHub Desktop.
debian apt
#!/bin/bash
# /usr/local/bin/apt
user=`whoami`
commands="apt-get clean; apt-get update; aptitude upgrade; aptitude dist-upgrade"
if [ $user != "root" ]; then
su root -c "${commands}"
else
eval $commands
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment