summaryrefslogtreecommitdiff
path: root/localwebbbscreate
blob: 07406c1a163838416d63eafa1c20d4c37e143777 (plain)
  1. #!/bin/sh
  2. NAME=webbbs
  3. PATH=$PATH:/usr/local/sbin
  4. USER=$2
  5. BBS=$3
  6. HOME=/web/$USER
  7. CGI=$HOME/www/cgi-local
  8. test "x$USER" = "x" && $1=""
  9. case "$1" in
  10. add)
  11. test "x$BBS" = "x" && exit 1
  12. echo -n "Adding bbs $BBS to webserver $USER: "
  13. test -d $HOME/webbbs || mkdir $HOME/webbbs
  14. mkdir $HOME/webbbs/$BBS
  15. test -d $CGI || mkdir $CGI
  16. chown $USER.www-data $CGI
  17. cp /usr/local/lib/scripts/darryl/webbbs/config.pl $CGI/$BBS.cgi
  18. chown $USER.www-data $CGI/$BBS.cgi
  19. chown -R $USER.www-data $HOME/webbbs
  20. chmod g+w $HOME/webbbs/$BBS
  21. chmod g+x,o= $CGI/$BBS.cgi
  22. echo "Done!"
  23. ;;
  24. del|delete|remove)
  25. test -d $HOME/webbbs/$BBS || exit 1
  26. echo -n "Deleting bbs $BBS from webserver $USER: "
  27. rm -rf $HOME/webbbs/$BBS
  28. rm -rf $CGI/$BBS.cgi
  29. echo "Done!"
  30. ;;
  31. *)
  32. echo "Usage: $NAME [ add | delete ] WEBSERVER BBS"
  33. exit 1
  34. ;;
  35. esac
  36. exit 0