Provisioning-switchs/configs/switches/script
Michaël Paulon 9894c0f240 vacances
2020-08-14 13:34:51 +02:00

12 lines
283 B
Bash
Executable file

#!/bin/bash
dir='../../configs-backup/'
name=$1
port=$(cat $dir$name.bak | grep interface | tail -n 1 | awk '{print $2}')
echo "hostname: \"$name\"" > $name.yml
echo "nb_ports: $port" >> $name.yml
echo "interfaces:" >> $name.yml
cat $dir$name.bak | grep interface -A 3 | less