Current time: 05-05-2024, 01:25 AM Hello There, Guest! (LoginRegister)


Post Reply 
Domain Disabled message howto?
Author Message
xokaido Offline
Newbie
*

Posts: 7
Joined: Dec 2008
Reputation: 0
Post: #2
RE: Domain Disabled message howto?
Here I wrote little bash script for that purpose... can share if anyone needs:
Quote:#!/bin/bash

DOM_DIR=/var/www/virtual # directory where all domains go
DOMAINS="`ls $DOM_DIR`" # domains we have
MOVED="`ls $DOM_DIR/suspend | grep -v 'htdocs'`" # directory where we would link for message
# this dir also should contain 'htdocs' subdir
for dom in $DOMAINS
do
if [ ${dom##*.} == "disabled" ] # if we have disabled domain...
then
DEST_DIR=${DOM_DIR}/${dom%.*} # destination dir = removed .disabled
[ ! -e ${DEST_DIR} ] && ln -s suspend ${DEST_DIR}
fi
done

###################################################################

for mov in $MOVED
# if dommain has been enabled
do
DOMAIN=${mov%.*} # remove .dsiabled string from it
[ -e ${DOM_DIR}/${DOMAIN} ] && unlink ${DOM_DIR}/${DOMAIN} # unlink domain if exists
mv ${DOM_DIR}/suspend/${mov} ${DOM_DIR}/${DOMAIN} # move folder *.disabled to its original position
done

change script to meet your needs, save it, name it whatever you like and after
place it in your cronjob (crontab -e then type five asterisks followed by the path of this script)
Here is the good link for crontab howto:
http://blog.fekw.de/2008/04/05/cronjob-crontab-howto/
Happy new year all... Big Grin
(This post was last modified: 01-01-2009 12:19 AM by xokaido.)
12-31-2008 11:54 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Domain Disabled message howto? - xokaido - 12-29-2008, 02:59 AM
RE: Domain Disabled message howto? - xokaido - 12-31-2008 11:54 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)