Added chrooted function
This commit is contained in:
parent
b5bc7350fe
commit
11dbc8071b
1 changed files with 12 additions and 0 deletions
12
aliases.zsh
12
aliases.zsh
|
@ -18,6 +18,18 @@ function mkcdir () {
|
|||
cd -P -- "$1"
|
||||
}
|
||||
|
||||
function chrooted() {
|
||||
ROOT_MP="$(awk '$5=="/" {print $1}' </proc/1/mountinfo)"
|
||||
SHELL_MP="$(awk '$5=="/" {print $1}' </proc/$$/mountinfo)"
|
||||
if [ "$ROOT_MP" -eq "$SHELL_MP" ];
|
||||
then
|
||||
echo "We are not chrooted."
|
||||
else
|
||||
echo "We are chrooted."
|
||||
fi
|
||||
return $(test "$ROOT_MP" -eq "$SHELL_MP")
|
||||
}
|
||||
|
||||
if [ -x "$(which lsb_release)" ];
|
||||
then
|
||||
current_dist=`lsb_release -c -s`
|
||||
|
|
Loading…
Reference in a new issue