9 . /etc/alternc/local.sh
10 . /usr/lib/alternc/functions.sh
12 # To not be case-sensitive
13 ACTION="`echo $ACTION|tr '[:upper:]' '[:lower:]'`"
14 DOMAIN="`echo $DOMAIN|tr '[:upper:]' '[:lower:]'`"
16 if [ -z $ACTION ] || [ -z $DOMAIN ] ; then
17 echo "Need at least 2 parameters ( action - fqdn )"
20 YOP="$ALTERNC_LOC/dns/$(print_domain_letter $DOMAIN)/$DOMAIN"
24 if [ ! -e "$YOP" ] ; then
25 echo "Link do not exist. Nothing done"
28 if [ ! -L "$YOP" ] ; then
29 echo "Seem not to be a link ($YOP). Abord"
35 if [ -z "$TARGET" ] ; then
36 echo "Parameters target $TARGET missing"
39 USER=$(get_account_by_domain "$DOMAIN")
40 if [ -z $USER ] ; then
41 echo "Unable to find account of $DOMAIN"
44 TARGET="$ALTERNC_LOC/html/$(print_user_letter $USER)/$USER/$TARGET"
45 if [ ! -d "$TARGET" ] ; then
46 echo "Directory $TARGET missing"
49 ln -snf "$TARGET" "$YOP"
52 echo Error : $ACTION not an recognised action