Changeset 2821 for alternc/trunk/src/update_domains.sh
- Timestamp:
- 01/29/11 18:58:19 (2 years ago)
- File:
-
- 1 edited
-
alternc/trunk/src/update_domains.sh (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
alternc/trunk/src/update_domains.sh
r2820 r2821 43 43 # Sub_domaines we want to delete 44 44 # sub_domaines.web_action = delete 45 for sub in $( $MYSQL_DO "select if(length(sd.sub)>0,concat_ws('.',sd.sub,sd.domaine),sd.domaine) from sub_domaines sd where web_action ='DELETE';") ; do46 host_delete $ sub45 for sub in $( $MYSQL_DO "select concat_ws('|µ',if(length(sd.sub)>0,concat_ws('.',sd.sub,sd.domaine),sd.domaine),sd.type) from sub_domaines sd where web_action ='DELETE';") ; do 46 host_delete $(echo $sub|tr '|µ' ' ') 47 47 # TODO Update the entry in the DB with the result and the action 48 48 done … … 52 52 params=$( $MYSQL_DO " 53 53 select concat_ws('|µ',lower(sd.type), if(length(sd.sub)>0,concat_ws('.',sd.sub,sd.domaine),sd.domaine), valeur) 54 from sub_domaines sd , domaines_type dt54 from sub_domaines sd 55 55 where sd.web_action ='UPDATE' 56 and lower(sd.type) = lower(dt.name)57 and dt.only_dns = false58 56 ;") 59 57 for sub in $params;do 60 58 host_create $(echo $sub|tr '|µ' ' ') 61 # TODO Update the entry in the DB with the result and the action59 $MYSQL_DO "update sub_domaines sd set web_action='OK',web_result='$?' where concat_ws('|µ',lower(sd.type),if(length(sd.sub)>0,concat_ws('.',sd.sub,sd.domaine),sd.domaine),valeur)='$sub'" 62 60 done 63 61 64 62 # Domaine to enable 65 for sub in $( $MYSQL_DO "select if(length(sd.sub)>0,concat_ws('.',sd.sub,sd.domaine),sd.domaine) from sub_domaines sd where sd.web_action='ENABLE' ;");do66 host_enable $ sub67 # TODO Update the entry in the DB with the result and the action63 for sub in $( $MYSQL_DO "select concat_ws('|µ',if(length(sd.sub)>0,concat_ws('.',sd.sub,sd.domaine),sd.domaine),lower(sd.type)) from sub_domaines sd where sd.enable ='ENABLE' ;");do 64 host_enable $(echo $sub|tr '|µ' ' ') 65 $MYSQL_DO "update sub_domaines sd set enable='ENABLED' where concat_ws('|µ',if(length(sd.sub)>0,concat_ws('.',sd.sub,sd.domaine),sd.domaine),lower(sd.type)) = '$sub';" 68 66 done 69 67 70 68 # Domains to disable 71 for sub in $( $MYSQL_DO "select if(length(sd.sub)>0,concat_ws('.',sd.sub,sd.domaine),sd.domaine) from sub_domaines sd where sd.web_action='DISABLE' ;");do72 host_disable $ sub73 # TODO Update the entry in the DB with the result and the action69 for sub in $( $MYSQL_DO "select concat_ws('|µ',if(length(sd.sub)>0,concat_ws('.',sd.sub,sd.domaine),sd.domaine),lower(sd.type)) from sub_domaines sd where sd.enable ='DISABLE' ;");do 70 host_disable $(echo $sub|tr '|µ' ' ') 71 $MYSQL_DO "update sub_domaines sd set enable='DISABLED' where concat_ws('|µ',if(length(sd.sub)>0,concat_ws('.',sd.sub,sd.domaine),sd.domaine),lower(sd.type)) = '$sub';" 74 72 done 75 73
Note: See TracChangeset
for help on using the changeset viewer.
