Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cat Hook/hook
- #!/usr/bin/env bash
- # Hier ^ bitte Sprache eintragen
- # Reihenfolge:
- # - Modifiziere Hooknamen;erlange Root
- # - Prüfe Namen,liste Dir
- # - Rufe Skript;behandle Output
- set -x
- if [ `/usr/bin/id -u` != 0 ]
- then
- case "$0" in
- /*)exec sudo "$0" "`/usr/bin/id -un`":"$@"
- ;;*) exec "$0" "$@"
- ;;esac
- fi
- export HOOK_pwd=/home/zybell/Hook
- case "$PWD"
- in "$HOOK_pwd")
- ;;*)cd "$HOOK_pwd";export HOOK_old="$OLDPWD"
- ;;esac
- case "$1"
- in -r-s------) shift;shift;u="`/usr/bin/id -un +$1`";
- shift 5;HOOK_cmd="$0" /bin/su --shell=/usr/bin/env "$u" "$2"/"$@"
- ;; "$SUDO_USER:") /bin/mkdir -m 1777 "$1$2"
- ;; "$SUDO_USER::") /bin/mkdir -m 1777 "::$2"
- ;; "$SUDO_USER::"*) SUDO_USER=: "$0" "`echo "$1"|/bin/grep -o ::'.*'`" "$@"
- ;; "$SUDO_USER:"*) /bin/ls --full-time -no --color=never --quoting=shell-always "$1"|
- /bin/grep ^-r-s------|
- /bin/sh -xc 'while read a ;do /bin/sh -xc '"'"'"$0" '"'"'"$a"'"'"' "$@"'"'"' "$0" "$@";done' "$0" "$@" |
- /bin/grep '^:$'
- ;; *) echo Unexpected "$@" >&2;exit 3
- ;; esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement