blob: c97b673bb3280ac69e784bc1dc94210f4bd37505 (
plain)
- #!/bin/sh
- #
- # /usr/local/sbin/localwebcalcreate
- # Copyright 2001 Jonas Smedegaard <dr@jones.dk>
- #
- # $Id: localwebcalcreate,v 1.2 2002-03-07 16:22:51 jonas Exp $
- #
- # Create local WebCAL
- #
- NAME=webcal
- PATH=$PATH:/usr/local/sbin
- USER=$2
- HOME=/web/$USER
- CGI=$HOME/www/cgi-local
- NEWNAME=kalender
- CAL=$HOME/www/$NEWNAME
- test "x$USER" = "x" && $1=""
- case "$1" in
- add)
- test "x$USER" = "x" && exit 1
- echo -n "Adding calendar to webserver $USER: "
- test -d $CGI || mkdir $CGI
- chown $USER.www-data $CGI
- cp /usr/local/lib/scripts/darryl/webcal/webcal.pl $CGI/$NEWNAME.cgi
- cp /usr/local/lib/scripts/darryl/webcal/webcal.add.pl $CGI/$NEWNAME.cgi
- cp /usr/local/lib/scripts/darryl/webcal/webcal.config.pl $CGI/$NEWNAME.cgi
- cp /usr/local/lib/scripts/darryl/webcal/webcal.delete.pl $CGI/$NEWNAME.cgi
- chown $USER.www-data $CGI/NEWNAME*.cgi
- chmod g+x,o= $CGI/$NEWNAME*.cgi
- mkdir $HOME/webcal
- cp /usr/local/lib/scripts/darryl/webcal/webcal.data $HOME/webcal/
- chown -R $USER.www-data $HOME/webcal
- chmod g+w $HOME/webcal/webcal.data
- mkdir $CAL
- chown -R $USER.www-data $CAL
- echo "Done!"
- ;;
- del|delete|remove)
- test -d $HOME/webcal || exit 1
- echo -n "Deleting calendar from webserver $USER: "
- rm -rf $CGI/$NEWNAME*.cgi
- rm -rf $HOME/webcal
- rm -rf $CAL
- echo "Done!"
- ;;
- *)
- echo "Usage: $NAME [ add | delete ] WEBSERVER"
- exit 1
- ;;
- esac
- exit 0
|