also prints out the command to use if they forgot to sudo.
use Env qw(HOME);
+# make sure we are running as root. otherwise we have no access to look at many things in /etc.
+if ($< != 0) {
+ printf "This script must be run as root or sudo. Try this:\n";
+ printf " sudo -E PERLLIB=\$PERLLIB perl $0 @ARGV\n";
+ exit 1;
+}
+
&initialize_snarfer;
# get the number we use and increment it for the next use.
return 0
}
- # defines a variable within the feisty meow environment and remembers that
- # this is a new or modified definition. if the feisty meow codebase is
- # unloaded, then so are all the variables that were defined.
- # this function always exports the variables it defines.
-# function define_yeti_variable()
-# {
-## if variable exists already, save old value for restore,
-## otherwise save null value for restore,
-## have to handle unsetting if there was no prior value of one
-## we newly defined.
-## add variable name to a list of feisty defined variables.
-#
-##hmmm: first implem just sets it up and exports the variable.
-## i.e., this method always exports.
-#export "${@}"
-#
-#
-#return 0
-# }
-
##############
#hmmm: this points to an extended functions file being needed; not all of these are core.
# this function always exports the variables it defines.
function define_yeti_variable()
{
-# if variable exists already, save old value for restore,
+ #hmmm: simple implem just sets it up and exports the variable.
+ # i.e., this method always exports.
+ export "${@}"
+
+#hmmm: eventual approach-- if variable exists already, save old value for restore,
# otherwise save null value for restore,
# have to handle unsetting if there was no prior value of one
# we newly defined.
# add variable name to a list of feisty defined variables.
-#hmmm: first implem just sets it up and exports the variable.
-# i.e., this method always exports.
-export "${@}"
-
-
return 0
}