Created
April 14, 2016 18:07
-
-
Save kinkerl/fda2d1857fa58371d5a242647fdbd586 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for arg; do | |
realarg="$(realpath "$arg")" | |
case "$realarg" in | |
/|/usr|/var|/etc|/home|/bin|/lib|/lib64|/boot|/opt|/media|/root) | |
echo "refusing to remove $realarg" 1>&2 | |
exit 100 | |
;; | |
esac | |
done | |
exec /bin/rm --one-file-system --preserve-root "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment