Initial commit

This commit is contained in:
2018-04-30 02:53:44 +02:00
commit f39b0fbcd8
26 changed files with 1755 additions and 0 deletions

19
snippets/is_chrooted.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# - Test if script is running in a chrooted environment
# -
# - !! Script MUST run with root privileges!!
# -
if [ "$(id -u)" != "0" ]; then
echo -e "\n\tThis script must be run as root.\n" 1>&2
exit 1
fi
if [[ "$(stat -c %d:%i /)" = "$(stat -c %d:%i /proc/1/root/.)" ]]; then
echo -e "\n\tRunning NOT in a chrooted environment.\n"
else
echo -e "\n\tRunning in a chrooted environment.\n"
fi