Prevent sudo (#1109)

This commit is contained in:
clsty
2025-02-11 22:07:55 +08:00
parent b4533d1dea
commit 51485562ec
2 changed files with 14 additions and 9 deletions
+4
View File
@@ -6,6 +6,10 @@
cd "$(dirname "$0")";export base="$(pwd)"
output_file=diagnose.result;rm $output_file
export LANG=C;export LC_ALL=C
case $(whoami) in
root)echo -e "\e[31m[$0]: This script is NOT to be executed with sudo or as root. Aborting...\e[0m";exit 1;;
esac
x() { ii_exec "$@" 2>&1 | tee -a $output_file ; }
e() { ii_box "$@" | tee -a $output_file ; }