Created
April 14, 2016 17:47
-
-
Save tamsanh/1fa3d92511f31cbfd4867132c1ced09a to your computer and use it in GitHub Desktop.
This file contains 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