#!/usr/bin/env bash ssh -i ~/.ssh/id-rsa -o PreferredAuthentications=publickey johnp@192.168.1.9 "show configuration | display set " >/tmp/noc-jmx-104-b.set ssh -i ~/.ssh/id-rsa -o PreferredAuthentications=publickey johnp@192.168.1.10 "show configuration | display set" >/tmp/noc-jmx-104-a.set for fn in noc-jmx-104-a.set noc-jmx-104-b.set ; do size=$(stat -c %s /tmp/$fn) if (( $size > 0 ));then mv /tmp/$fn /configs/mx else rm /tmp/$fn fi done