aboutsummaryrefslogtreecommitdiff
path: root/sbocheck
diff options
context:
space:
mode:
Diffstat (limited to 'sbocheck')
-rwxr-xr-xsbocheck7
1 files changed, 6 insertions, 1 deletions
diff --git a/sbocheck b/sbocheck
index f10ced7..bf2ddff 100755
--- a/sbocheck
+++ b/sbocheck
@@ -13,7 +13,7 @@
use 5.16.0;
use strict;
use warnings FATAL => 'all';
-use SBO::Lib qw/ update_tree get_available_updates script_error open_fh is_local show_version get_local_outdated_versions /;
+use SBO::Lib qw/ _ERR_USAGE update_tree get_available_updates script_error open_fh is_local show_version get_local_outdated_versions /;
use Getopt::Long;
use File::Basename;
use List::Util 'max';
@@ -42,6 +42,11 @@ GetOptions('help|h' => \$help, 'version|v' => \$vers);
if ($help) { show_usage(); exit 0 }
if ($vers) { show_version(); exit 0 }
+unless ($< == 0) {
+ warn "This script requires root privileges.\n";
+ exit
+}
+
update_tree();
# retrieve and format list of available updates