remove interface
[dell-switch] / sw-running-config.sh
index ffa7167..6640f0f 100755 (executable)
@@ -1,8 +1,15 @@
-#!/bin/sh -xe
+#!/bin/sh -e
+
+if [ -z "$1" ] ; then
+       ./sw-names | xargs -i $0 {}
+       exit 0
+fi
 
 sw=$1
 
-NO_LOG=1 ./dell-switch.pl $sw "copy running-config tftp://10.20.0.216/$sw"
+config=$( basename $0 | sed -e 's/^sw-//' -e 's/.sh$//' )
+
+NO_LOG=1 ./dell-switch.pl $sw "copy $config tftp://10.20.0.216/$sw"
 cd running-config
 git add $sw
-git commit -m $sw
+git commit -m "$sw $config"