#!/bin/bash # # mkproxy v0.1: create an apache vhost entry and reload the web server # feedback: rhatto at riseup.net | gpl # # This is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # This software is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # TMP="/tmp" MKSITE_BASE="/etc/mksite" CONF="$MKSITE_BASE/mksite.conf" MESSAGES="/usr/share/mksite/mksite.messages" LOCKFILE="$TMP/mkproxy.lock" HELPER_FUNCTIONS="/usr/libexec/mksite/mksite-helper" if [ -f "$HELPER_FUNCTIONS" ]; then source $HELPER_FUNCTIONS mksite_checks else echo Fatal error: function file not found, aborting. echo Erro fatal: arquivo de funcoes nao encontrado, abortando. exit 1 fi mksite_create_lockfile $LOCKFILE function mkproxy.usage { echo "usage: `basename $0` [noreload]" } if [ -z "$1" ]; then mkproxy.usage mksite_safe_exit 1 else USER="$1" if [ "$2" == "noreload" ]; then NORELOAD="1" else NORELOAD="0" fi fi # check if site config exist mksite_check_site_config if [ "$CONFIG_EXIST" == "1" ]; then mksite_gen_proxy_vhost $MKSITE_BASE/sites/$USER if [ "$NORELOAD" == "0" ]; then mksite_regen_apache fi fi mksite_safe_exit 0