]>
Commit | Line | Data |
---|---|---|
e9689537 ER |
1 | #!/bin/sh |
2 | webapps=/etc/webapps | |
3 | action="$1" | |
f21ce9bd | 4 | httpd="$2" |
e9689537 ER |
5 | app="$3" |
6 | ||
7 | webapp_register() { | |
f21ce9bd | 8 | ln -sf $webapps/$app/$httpd.conf /etc/$httpd/webapps/$app.conf |
e9689537 ER |
9 | } |
10 | ||
11 | webapp_unregister() { | |
f21ce9bd | 12 | rm -f /etc/$httpd/webapps/$app.conf |
e9689537 ER |
13 | } |
14 | ||
15 | usage() { | |
16 | cat >&2 <<EOF | |
f21ce9bd ER |
17 | Usage: $0 register httpd webapp |
18 | Usage: $0 unregister httpd webapp | |
19 | ||
20 | Where httpd one of the webservers | |
21 | apache 1.x: apache | |
22 | apache 2.x: httpd | |
23 | lighttpd: lighttpd | |
e9689537 ER |
24 | EOF |
25 | } | |
26 | ||
27 | case "$action" in | |
28 | register) | |
d91deb44 | 29 | webapp_register |
e9689537 ER |
30 | ;; |
31 | unregister) | |
d91deb44 | 32 | webapp_unregister |
e9689537 ER |
33 | ;; |
34 | *) | |
35 | usage | |
36 | exit 1 | |
37 | esac |