diff options
author | Matteo Pasotti <matteo.pasotti@gmail.com> | 2013-08-24 15:05:23 +0200 |
---|---|---|
committer | Matteo Pasotti <matteo.pasotti@gmail.com> | 2013-08-24 15:05:23 +0200 |
commit | f76ba5b32e54269b843a718446e0943183d9a719 (patch) | |
tree | 9c2cfebbb84463f561d586d175e9a09c56db1814 /extras/setup.sh | |
parent | ec8aefe148fbe9ddd0f071a6bb02cf92291d2223 (diff) | |
download | manatools-f76ba5b32e54269b843a718446e0943183d9a719.tar manatools-f76ba5b32e54269b843a718446e0943183d9a719.tar.gz manatools-f76ba5b32e54269b843a718446e0943183d9a719.tar.bz2 manatools-f76ba5b32e54269b843a718446e0943183d9a719.tar.xz manatools-f76ba5b32e54269b843a718446e0943183d9a719.zip |
configure xhost to allow sudo usage by apanel
Diffstat (limited to 'extras/setup.sh')
-rwxr-xr-x | extras/setup.sh | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/extras/setup.sh b/extras/setup.sh index 0e6a51e3..bbb0645b 100755 --- a/extras/setup.sh +++ b/extras/setup.sh @@ -31,6 +31,19 @@ function uninstall echo "== Removed" } +# setup xhost to make apanel able to gain the required privileges using sudo +function setup_xhost_conf { + echo "== Setup xhost settings" + xhost +local:root + echo "== Done" +} + +function uninstall_xhost_conf { + echo "== xhost settings restored" + xhost - + echo "== Done" +} + function setup { echo "== Installing AdminPanel..." pushd . @@ -44,19 +57,20 @@ function setup { function usage { echo "Usage:" - echo "--remove uninstall AdminPanel references" - echo "--install install AdminPanel references" + echo "--remove uninstall AdminPanel references" + echo "--install install AdminPanel references" + echo "--privilege define the authentication method to gain privileges (NOT IMPLEMENTED YET)" } check_root_permissions -while getopts "hri" OPTIONS +while getopts "hrip:" OPTIONS do case $OPTIONS in - r ) uninstall ;; - i ) uninstall && setup ;; + r ) uninstall && uninstall_xhost_conf ;; + i ) setup && setup_xhost_conf ;; h ) usage ;; - \? ) usage ;; + * ) usage ;; esac done |