Skip to content

Commit

Permalink
upload script now takes in upload folder name
Browse files Browse the repository at this point in the history
  • Loading branch information
Athryx committed Feb 9, 2024
1 parent c840d5b commit 3c6ab2b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

files=""

if [ -z "$1" ] || [ -z "$2" ]
then
echo "usage: hostname upload_folder"
exit 1
fi

if [ -e ap.img ]
then
files="ap.img"
Expand All @@ -14,7 +20,7 @@ fi

if [ -n "$files" ]
then
rsync -av --progress --rsync-path="mkdir -p /home/ectf/CI/rpi/upload && rsync" $files $1:/home/ectf/CI/rpi/upload
rsync -av --progress --rsync-path="mkdir -p /home/ectf/CI/rpi/upload/$2 && rsync" $files $1:/home/ectf/CI/rpi/upload/$2
else
echo "ap.img and component.img do not exist"
fi

0 comments on commit 3c6ab2b

Please sign in to comment.