about to test this on rr-middleware...

This commit is contained in:
2025-06-30 13:23:24 -05:00
parent d82c8733fa
commit f3070de151
7 changed files with 40 additions and 95 deletions

View File

@@ -19,7 +19,8 @@ export PS4='(${BASH_SOURCE}:${LINENO}): - [${SHLVL},${BASH_SUBSHELL},$?] $ '
function error_out()
{
echo "Bailing out. See above for reason...."
print_error "$1"
print_error "Bailing out. See above for reason...."
exit 1
}

View File

@@ -3,29 +3,17 @@
function PreflightCheck()
{
#Common things I check for in the scripts I write.
export curr_user="$USER"
export user_check
#export curr_host="$(hostname)"
#export curr_user="$USER"
#export host_check="$(echo $curr_host | grep -c <desired hostname>)"
#export user_check="$(echo $curr_user | grep -c <desired username>)"
user_check="$(echo "$curr_user" | grep -c root)"
#if [ $host_check -ne 1 ]; then
# echo "Must run on <desired host>."
# error_out
#fi
#if [ $user_check -ne 1 ]; then
# echo "Must run as <desired user>."
# error_out
#fi
if [ $user_check -ne 1 ]; then
print_error "Must run as root."
error_out
fi
#if [ "$ARG_COUNT" -ne <the right num> ]; then
# help
# error_out
#fi
#Your additional stuff here...
echo "All checks passed...."
}