modified: pixi.toml
[GalaxyCodeBases.git] / etc / Mac / rootless.sh
blob6f8776d7798e0830e97b2b4c4bc01986554d5cb4
1 #!/bin/bash
2 ME=`basename $0`
3 IS=$(nvram boot-args | awk '{ print $2 }' | grep rootless | cut -d= -f2)
4 if [ $# -lt 1 ]; then
5 if [ "$IS" == "1" ]; then
6 echo "Rootless mode currently active. Use $ME 0 to deactivate."
7 else
8 echo "rootless mode currently inactive. Use $ME 1 to activate."
9 fi
10 exit
12 if [ "$1" == "0" ]; then
13 if [ "$IS" == "1" ]; then
14 sudo nvram boot-args="rootless=0";
15 echo "Rootless mode deactivated. Reboot to apply.";
16 else
17 echo "Rootless mode already inactive. Nothing changed.";
19 else
20 if [ "$IS" == "0" ]; then
21 sudo nvram boot-args="rootless=1";
22 echo "Rootless mode activated. Reboot to apply.";
23 else
24 echo "Rootless mode already active. Nothing changed.";