summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doUpgrade.go2
-rw-r--r--exit.go3
2 files changed, 3 insertions, 2 deletions
diff --git a/doUpgrade.go b/doUpgrade.go
index 7f514a0..45ea369 100644
--- a/doUpgrade.go
+++ b/doUpgrade.go
@@ -37,7 +37,7 @@ func doUpgrade() error {
}
if !argv.DryRun {
- // checkSuperuser()
+ checkSuperuser()
debian.AptUpdate()
// try to re-init due to new apt lists
me.machine = debian.InitMachine()
diff --git a/exit.go b/exit.go
index 7e1a9b0..c60766c 100644
--- a/exit.go
+++ b/exit.go
@@ -4,6 +4,7 @@
package main
import (
+ "errors"
"fmt"
"os"
@@ -14,7 +15,7 @@ import (
// exits if not root
func checkSuperuser() {
if os.Getuid() != 0 {
- me.sh.BadExit("you must run as root", nil)
+ me.sh.BadExit("need sudo", errors.New("this requires sudo acces"))
}
}