SOURCES: webapps.sh - added list-apps and more usage

gotar gotar at pld-linux.org
Fri Jan 6 16:03:12 CET 2006


Author: gotar                        Date: Fri Jan  6 15:03:12 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- added list-apps and more usage

---- Files affected:
SOURCES:
   webapps.sh (1.8 -> 1.9) 

---- Diffs:

================================================================
Index: SOURCES/webapps.sh
diff -u SOURCES/webapps.sh:1.8 SOURCES/webapps.sh:1.9
--- SOURCES/webapps.sh:1.8	Wed Dec  7 01:42:41 2005
+++ SOURCES/webapps.sh	Fri Jan  6 16:03:07 2006
@@ -1,4 +1,5 @@
 #!/bin/sh
+
 webapps=/etc/webapps
 webservers='apache httpd lighttpd'
 action="$1"
@@ -32,12 +33,23 @@
 	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 @@
 
 checkconfig() {
 	if [ -z "$httpd" ] || [ -z "$app" ]; then
-	   	usage
+		usage
 		return
 	fi
 
@@ -80,6 +92,9 @@
 	;;
 list)
 	webapp_list $2
+	;;
+list-apps)
+	webapp_list_apps $2
 	;;
 *)
 	usage
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/webapps.sh?r1=1.8&r2=1.9&f=u



More information about the pld-cvs-commit mailing list