diff --git a/upgrade.sh b/upgrade.sh index 029483b5..66748216 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -34,6 +34,12 @@ if [ ! -d /opt/wrolpi ] || [ ! -d /opt/wrolpi/wrolpi ]; then exit 2 fi +# Re-execute this script if it wasn't called with sudo. +if [ $EUID != 0 ]; then + sudo "$0" "$@" + exit $? +fi + set -x set -e