source: alternc-vhost/trunk/usr/lib/alternc/hosting_manage.sh @ 2586

Revision 2586, 1.0 KB checked in by azerttyu, 4 years ago (diff)

Gerer les redirections d'url

  • un fichier de conf par defaut
  • surement a affiner
  • Property svn:executable set to *
Line 
1#!/bin/sh
2
3##Variables de configuration
4while getopts  "a:f:t:d:u:r:" flag
5do
6    #echo "$flag" $OPTIND $OPTARG #afficher les arguments fournis
7    case $flag in
8        a)
9            #Argument attendu : create/update/delete
10            action=$OPTARG
11            ;;
12        t)
13            #Argument attendu : panel/webmail/vhost
14            type=$OPTARG
15            ;;
16        f)
17            fqdn=$OPTARG
18            param[1]=$fqdn
19            ;;
20        d)
21            #Argument attendu : chemin absolu du domaine géré
22            directory=$OPTARG
23            param[2]=$directory
24            ;;
25        u)
26            #Argument attendu : un nom
27            user=$OPTARG
28            param[0]=$user
29            ;;       
30        r)
31            #Argument attendu : un nom
32            redirect=$OPTARG
33            param[3]=$redirect
34            ;;                   
35    esac
36done
37
38. /usr/lib/alternc/hosting_functions.sh
39
40if type host_$action"_"$type >/dev/null 2>&1; then
41    echo "création $type lancé"
42    host_$action"_"$type ${param[@]}
43fi
Note: See TracBrowser for help on using the repository browser.