|
|
@@ -0,0 +1,17 @@
|
|
|
+#!/bin/bash
|
|
|
+cd /switchbackup
|
|
|
+for switch in $(cat ./creds.txt); do
|
|
|
+
|
|
|
+ TP_HOST=$(echo ${switch} | cut -d ";" -f 1)
|
|
|
+ TP_IP=$(echo ${switch} | cut -d ";" -f 2)
|
|
|
+ TP_USER=$(echo ${switch} | cut -d ";" -f 3)
|
|
|
+ TP_PASS=$(echo ${switch} | cut -d ";" -f 4)
|
|
|
+
|
|
|
+
|
|
|
+ ./get-conf.sh $TP_HOST $TP_IP $TP_USER $TP_PASS
|
|
|
+ mv ./${TP_HOST}.cfg ./tp-link/${TP_HOST}_`date +%Y%m%d`.cfg
|
|
|
+
|
|
|
+ if [ $? -ne 0 ]; then
|
|
|
+ echo "Die Switch ${TP_HOST} konnte nicht gesichert werden" | mail -s "Switch-Backup" admin@klenzel.de
|
|
|
+ fi
|
|
|
+done
|