]> git.pld-linux.org Git - packages/webapps.git/commitdiff
- added list-apps and more usage
authorTomasz Pala <gotar@pld-linux.org>
Fri, 6 Jan 2006 15:03:07 +0000 (15:03 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    webapps.sh -> 1.9

webapps.sh

index 1842e42dda7187db38b72bdd2a7e249c26b8865d..6cc7d000e41496c1f0162877efe3875e2357fea0 100644 (file)
@@ -1,4 +1,5 @@
 #!/bin/sh
+
 webapps=/etc/webapps
 webservers='apache httpd lighttpd'
 action="$1"
@@ -32,12 +33,23 @@ webapp_list() {
        done
 }
 
+webapp_list_apps() {
+       echo "available webapps${1:+ for $1}":
+       for server in ${1:-\\*}; do
+               for app in `ls /etc/webapps`; do
+                       eval find /etc/webapps/$app -name $server.conf -printf '"- $app\n"'
+               done | uniq
+       done
+}
+
 usage() {
        cat >&2 <<EOF
 Usage: $0 register httpd webapp
 Usage: $0 register httpd webapp/module
 Usage: $0 unregister httpd webapp
 Usage: $0 unregister httpd webapp/module
+Usage: $0 list [$webservers]
+Usage: $0 list-apps [$webservers]
 
 Where httpd is one of the webservers
 apache 1.x: apache
@@ -56,7 +68,7 @@ die() {
 
 checkconfig() {
        if [ -z "$httpd" ] || [ -z "$app" ]; then
-               usage
+               usage
                return
        fi
 
@@ -81,6 +93,9 @@ unregister)
 list)
        webapp_list $2
        ;;
+list-apps)
+       webapp_list_apps $2
+       ;;
 *)
        usage
        exit 1
This page took 0.108652 seconds and 4 git commands to generate.