#!/bin/bash VSRX_HOST="clab-jncia-router1 clab-jncia-router2 clab-jncia-switch1 clab-jncia-switch2" USER=root DEST_DIR=/home/user1/containerlab/jncia/vsrx-backups CONFIG_NAME=juniper.conf.gz mkdir -p "$DEST_DIR" for x in $VSRX_HOST do scp ${USER}@${x}:/config/${CONFIG_NAME} ${DEST_DIR}/${CONFIG_NAME} gunzip ${DEST_DIR}/juniper.conf.gz mv ${DEST_DIR}/juniper.conf ${DEST_DIR}/$x.conf done