1 2 3 4 5 6 7 8 9 10 11
#!/bin/bash version=$(sw_vers -productVersion) if [[ ${version} = 1.0* || ${version} = 1.1.[012] ]]; then user=root else user=mobile fi su -c "${user}" "$@"