dns edit
Kategorie: linux

#!/bin/bash

DOMENA=$1;
ODKUD=$2;
KAM=$3;


if [ $ODKUD == \"b01\" ]; then IP_ODKUD=\"82.208.39.113\"; fi;
if [ $KAM == \"b01\" ]; then IP_KAM=\"82.208.39.113\"; fi;

if [ $ODKUD == \"b02\" ]; then IP_ODKUD=\"82.208.39.114\"; fi;
if [ $KAM == \"b02\" ]; then IP_KAM=\"82.208.39.114\"; fi;

if [ $ODKUD == \"b03\" ]; then IP_ODKUD=\"82.208.39.113\"; fi;
if [ $KAM == \"b03\" ]; then IP_KAM=\"82.208.39.113\"; fi;

if [ $ODKUD == \"b05\" ]; then IP_ODKUD=\"82.208.39.117\"; fi;
if [ $KAM == \"b05\" ]; then IP_KAM=\"82.208.39.117\"; fi;

if [ $ODKUD == \"b07\" ]; then IP_ODKUD=\"82.208.39.119\"; fi;
if [ $KAM == \"b07\" ]; then IP_KAM=\"82.208.39.119\"; fi;

if [ $ODKUD == \"b08\" ]; then IP_ODKUD=\"82.208.39.120\"; fi;
if [ $KAM == \"b08\" ]; then IP_KAM=\"82.208.39.120\"; fi;

if [ $ODKUD == \"b09\" ]; then IP_ODKUD=\"82.208.39.121\"; fi;
if [ $KAM == \"b09\" ]; then IP_KAM=\"82.208.39.121\"; fi;

if [ $ODKUD == \"b10\" ]; then IP_ODKUD=\"82.208.39.122\"; fi;
if [ $KAM == \"b10\" ]; then IP_KAM=\"82.208.39.122\"; fi;

if [ $ODKUD == \"b18\" ]; then IP_ODKUD=\"81.0.234.118\"; fi;
if [ $KAM == \"b18\" ]; then IP_KAM=\"81.0.234.118\"; fi;


#echo $IP_ODKUD;

SERIAL=`date +%Y%m%d%H`;
echo $SERIAL;
sed -i \"/serial/ c $SERIAL ; serial\" $DOMENA
sed -i \"s/$IP_ODKUD/$IP_KAM/g\" $DOMENA


7.6.2007 1:04:20