From: <abe...@us...> - 2011-12-06 00:57:34
|
Revision: 5285 http://astlinux.svn.sourceforge.net/astlinux/?rev=5285&view=rev Author: abelbeck Date: 2011-12-06 00:57:28 +0000 (Tue, 06 Dec 2011) Log Message: ----------- master-upload script added for Darrick's use Added Paths: ----------- branches/1.0/scripts/master-upload Added: branches/1.0/scripts/master-upload =================================================================== --- branches/1.0/scripts/master-upload (rev 0) +++ branches/1.0/scripts/master-upload 2011-12-06 00:57:28 UTC (rev 5285) @@ -0,0 +1,130 @@ +#!/bin/bash +# +# master-upload input_path +# + +MIRROR_IMG_PATH="/downloads/img" + +MIRROR_FIRMWARE_PATH="/firmware-1.x" + +MIRROR_FIRMWARE_PATH_18="/ast18-firmware-1.x" + +input_path="$1" + +auth_file="$HOME/.astlinux-ftp-repo" + +success_count=0 + +upload_file() +{ + local remote_dir="$1" file="$2" count="$3" + + ./toolchain/ncftpput -f "$auth_file" -z -r10 "$remote_dir" $file + + if [ $? -eq 0 ]; then + if [ "$count" = "count" ]; then + success_count=$((success_count+1)) + fi + else + echo "master-upload: failed." + exit 1 + fi +} + +upload_run_images() +{ + local local_dir="$1" firmware_path="$2" ver="/tmp/ver" + + for board in $(ls -1 "$local_dir"); do + echo "Run Image for Board: $board" + file="$(ls -1 "$local_dir/$board/"*.tar.gz | head -n1)" + file_sha1="$(ls -1 "$local_dir/$board/"*.tar.gz.sha1 | head -n1)" + if [ -n "$file" -a -n "$file_sha1" ]; then + upload_file "$firmware_path/$board" "$file $file_sha1" count + else + echo "master-upload: missing file(s) in \"$local_dir/$board/\"" + exit 1 + fi + + # Successful upload, update the 'ver' file + file_ver="$(basename "$file" .tar.gz)" + echo "$file_ver" > "$ver" + upload_file "$firmware_path/$board" "$ver" + rm -f "$ver" + echo "" + done +} + +upload_flash_images() +{ + local local_dir="$1" firmware_path="$2" + + for board in $(ls -1 "$local_dir"); do + echo "Flash Image for Board: $board" + file="$(ls -1 "$local_dir/$board/"*.img.gz | head -n1)" + if [ -n "$file" ]; then + upload_file "$firmware_path/$board" "$file" count + else + echo "master-upload: missing file(s) in \"$local_dir/$board/\"" + exit 1 + fi + echo "" + done +} + +if [ -z "$input_path" ]; then + echo "Usage: master-upload input_path" + exit 1 +fi + +if [ ! -d "$input_path" ]; then + echo "master-upload: directory \"$input_path\" not found." + exit 1 +else + check_img=0 + check_firmware=0 + for dir in $(ls -1 "$input_path"); do + case $dir in + *img) check_img=1 ;; + *firmware-1.x) check_firmware=1 ;; + esac + done + if [ $check_img -eq 0 -o $check_firmware -eq 0 ]; then + echo "master-upload: missing img/firmware-1.x directories." + exit 1 + fi +fi + +if [ ! -f "$auth_file" ]; then + echo "master-upload: authentication file \"$auth_file\" not found." + exit 1 +fi + +upload_host="$(cat "$auth_file" | awk '/^host / { print $2 }')" +upload_user="$(cat "$auth_file" | awk '/^user / { print $2 }')" +upload_pass="$(cat "$auth_file" | awk '/^pass / { print $2 }')" + +if [ -z "$upload_host" -o -z "$upload_user" -o -z "$upload_pass" ]; then + echo "master-upload: host/user/pass missing in \"$auth_file\"" + exit 1 +fi +unset upload_pass + +# Upload Asterisk 1.4 .tar.gz run images +upload_run_images "$input_path/firmware-1.x" "$MIRROR_FIRMWARE_PATH" + +# Upload Asterisk 1.4 .img.gz flash images +upload_flash_images "$input_path/img" "$MIRROR_IMG_PATH" + +# Upload Asterisk 1.8 .tar.gz run images +upload_run_images "$input_path/ast18-firmware-1.x" "$MIRROR_FIRMWARE_PATH_18" + +# Upload Asterisk 1.8 .img.gz flash images +upload_flash_images "$input_path/ast18-img" "$MIRROR_IMG_PATH" + +echo " +## +## Master Upload Finished for '$success_count' Images +## +" + Property changes on: branches/1.0/scripts/master-upload ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2012-12-17 18:01:49
|
Revision: 5818 http://astlinux.svn.sourceforge.net/astlinux/?rev=5818&view=rev Author: abelbeck Date: 2012-12-17 18:01:43 +0000 (Mon, 17 Dec 2012) Log Message: ----------- fix typo in comment Modified Paths: -------------- branches/1.0/scripts/master-upload Modified: branches/1.0/scripts/master-upload =================================================================== --- branches/1.0/scripts/master-upload 2012-12-17 17:57:57 UTC (rev 5817) +++ branches/1.0/scripts/master-upload 2012-12-17 18:01:43 UTC (rev 5818) @@ -125,7 +125,7 @@ fi # -# Uplaod Asterisk 1.4, 1.8 and 11 versions of AstLinux +# Upload Asterisk 1.4, 1.8 and 11 versions of AstLinux # for asterisk in ast14 ast18 ast11; do This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2016-06-17 15:56:02
|
Revision: 7726 http://sourceforge.net/p/astlinux/code/7726 Author: abelbeck Date: 2016-06-17 15:56:00 +0000 (Fri, 17 Jun 2016) Log Message: ----------- No longer upload '.img.gz' files since they are contained in the '.iso' files Modified Paths: -------------- branches/1.0/scripts/master-upload Modified: branches/1.0/scripts/master-upload =================================================================== --- branches/1.0/scripts/master-upload 2016-06-17 15:50:31 UTC (rev 7725) +++ branches/1.0/scripts/master-upload 2016-06-17 15:56:00 UTC (rev 7726) @@ -138,7 +138,7 @@ done # Upload .img.gz flash images -upload_flash_images "$input_path/img" "downloads/img" +#upload_flash_images "$input_path/img" "downloads/img" # Upload .iso installer images upload_iso_images "$input_path/iso" "downloads/iso" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |