blob: 07406c1a163838416d63eafa1c20d4c37e143777 (
plain)
- #!/bin/sh
- NAME=webbbs
- PATH=$PATH:/usr/local/sbin
- USER=$2
- BBS=$3
- HOME=/web/$USER
- CGI=$HOME/www/cgi-local
- test "x$USER" = "x" && $1=""
- case "$1" in
- add)
- test "x$BBS" = "x" && exit 1
- echo -n "Adding bbs $BBS to webserver $USER: "
- test -d $HOME/webbbs || mkdir $HOME/webbbs
- mkdir $HOME/webbbs/$BBS
- test -d $CGI || mkdir $CGI
- chown $USER.www-data $CGI
- cp /usr/local/lib/scripts/darryl/webbbs/config.pl $CGI/$BBS.cgi
- chown $USER.www-data $CGI/$BBS.cgi
- chown -R $USER.www-data $HOME/webbbs
- chmod g+w $HOME/webbbs/$BBS
- chmod g+x,o= $CGI/$BBS.cgi
- echo "Done!"
- ;;
- del|delete|remove)
- test -d $HOME/webbbs/$BBS || exit 1
- echo -n "Deleting bbs $BBS from webserver $USER: "
- rm -rf $HOME/webbbs/$BBS
- rm -rf $CGI/$BBS.cgi
- echo "Done!"
- ;;
- *)
- echo "Usage: $NAME [ add | delete ] WEBSERVER BBS"
- exit 1
- ;;
- esac
- exit 0
|