]> git.pld-linux.org Git - packages/webapps.git/blobdiff - webapps.sh
- preserve perms
[packages/webapps.git] / webapps.sh
index 87c61c2403f1bfa4ce613482fb60f99ce0785c66..bc79e2594d53b2fae5e0d38867b2fb33b3f9879c 100644 (file)
@@ -33,6 +33,22 @@ webapp_list() {
        done
 }
 
+# return registered application list for webserver
+# useful for bash_completion parsing
+webapp_apps_registered() {
+       local action="$1"
+       local server=$2
+
+       for conf in /etc/$server/webapps.d/*.conf; do
+               [ -L $conf ] || continue
+               appname=$(readlink $conf)
+               appname=${appname#*$webapps/}
+               appname=${appname%/$server.conf}
+               [ -f /etc/webapps/$appname/$server.conf ] || continue
+               echo $appname
+       done
+}
+
 # return application list for webserver
 # useful for bash_completion parsing
 webapp_applist() {
@@ -124,7 +140,17 @@ unregister)
 list)
        webapp_list $2
        ;;
-list-apps|list-apps-registered|list-apps-unregistered)
+list-apps)
+               webapp_list_apps
+       ;;
+list-apps-registered)
+       if [ "$2" ]; then
+               webapp_apps_registered $action $2
+       else
+               webapp_list_apps
+       fi
+       ;;
+list-apps-unregistered)
        if [ "$2" ]; then
                webapp_applist $action $2
        else
This page took 0.069864 seconds and 4 git commands to generate.