Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Script to Push Files

$
0
0
Hey Guys, Thanks for always being helpful, I have another issue that I need a little insight on how to fix.

See the below script I have and the error I get. I don't understand why it does that, am I not using the continue correctly?

Code:

#!/bin/bash -x
# @(#) File: filepush.sh
# ---------------------------------------------------------------------------
# Modication History:
# Date      Name                      Description
# 12/10/2014  Emmanuel Iroanya          Script to copy a file to all hosts listed in serverlist file
# ---------------------------------------------------------------------------

source /opt/mgr/conf/file.conf
source /opt/mgr/conf/dest.conf
HOSTS=/opt/mgr/conf/$1serverlist.conf

echo "Are you sure you want to copy $file to the list of $1 servers"
echo "This may take a while!!"
echo -n "Enter 'y' or 'n':"
read CHOICE
case "$CHOICE" in
        y|yes|Yes) while read line
do
        ssh "$line" "mkdir -p $dest" && scp -r "$file" "$line:$dest"
done < $HOSTS
        continue ;;
    n|no|No) echo "Please try again later"

esac

Code:

./filepush: line 30: continue: only meaningful in a `for', `while', or `until' loop

Viewing all articles
Browse latest Browse all 16232

Latest Images

Trending Articles



Latest Images