better scripts

This commit is contained in:
2025-07-29 02:07:07 +02:00
parent f648bdc99a
commit f2144078e9
8 changed files with 37 additions and 26 deletions

View File

@@ -12,6 +12,10 @@ if [ "$LOGNAME" != "$USER" ]; then
exit 1
fi
if [ "$(ps -o comm= -p $(ps -o ppid= -p $$) 2>/dev/null)" = "su" ]; then
exit 1
ppid=$(ps -o ppid= -p $$ 2>/dev/null)
if [ -n "$ppid" ]; then
parent_comm=$(ps -o comm= -p "$ppid" 2>/dev/null)
if [ "$parent_comm" = "su" ]; then
exit 1
fi
fi