From f76ba5b32e54269b843a718446e0943183d9a719 Mon Sep 17 00:00:00 2001 From: Matteo Pasotti Date: Sat, 24 Aug 2013 15:05:23 +0200 Subject: configure xhost to allow sudo usage by apanel --- extras/setup.sh | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'extras') diff --git a/extras/setup.sh b/extras/setup.sh index 0e6a51e..bbb0645 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 -- cgit v1.2.1