]> git.pld-linux.org Git - packages/webapps.git/commitdiff
- error checks
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 20 Nov 2005 18:03:30 +0000 (18:03 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    webapps.sh -> 1.4

webapps.sh

index 2d5fabef19720d56286b1685255486d715ca29c9..6aa33deb9c7b40a507a16b7211c92ac66da0efd6 100644 (file)
@@ -17,18 +17,35 @@ usage() {
 Usage: $0 register httpd webapp
 Usage: $0 unregister httpd webapp
 
-Where httpd one of the webservers
+Where httpd is one of the webservers
 apache 1.x: apache
 apache 2.x: httpd
 lighttpd: lighttpd
 EOF
 }
 
+die() {
+       echo >&2 "$0: $*"
+       exit 1
+}
+
+checkconfig() {
+       # sanity check
+       if [ ! -d "$webapps/$app" ]; then
+               die "Missing directory: $webapps/$app"
+       fi
+       if [ ! -d "/etc/$httpd/webapps" ]; then
+               die "Missing directory: /etc/$httpd/webapps"
+       fi
+}
+
 case "$action" in
 register)
+       checkconfig
        webapp_register
        ;;
 unregister)
+       checkconfig
        webapp_unregister
        ;;
 *)
This page took 0.024988 seconds and 4 git commands to generate.