diff options
author | Thomas Preud'homme <robotux@debian.org> | 2018-03-01 22:42:01 +0000 |
---|---|---|
committer | Thomas Preud'homme <robotux@debian.org> | 2018-03-01 22:42:01 +0000 |
commit | 3958fa914c8a524ed4b6a5b035b794e12708fa1d (patch) | |
tree | 417868397f3c2c7386773f55096a9aa5f8856990 /tools/to-pack/4-upload.sh |
Import ultracopier_1.4.0.4.orig.tar.xz
[dgit import orig ultracopier_1.4.0.4.orig.tar.xz]
Diffstat (limited to 'tools/to-pack/4-upload.sh')
-rwxr-xr-x | tools/to-pack/4-upload.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tools/to-pack/4-upload.sh b/tools/to-pack/4-upload.sh new file mode 100755 index 0000000..d908ddd --- /dev/null +++ b/tools/to-pack/4-upload.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +export TEMP_PATH="/mnt/world/ultracopier-temp/" +export ULTRACOPIER_SOURCE="/home/user/Desktop/ultracopier/sources/" +export BASE_PWD=`pwd` + +cd ${BASE_PWD} + +export ULTRACOPIER_VERSION=`grep -F "ULTRACOPIER_VERSION" ${ULTRACOPIER_SOURCE}/Variable.h | grep -F "1.2" | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` +function valid_ip() +{ + local ip=$1 + local stat=1 + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} +if ! valid_ip ${ULTRACOPIER_VERSION}; then + echo Wrong version: ${ULTRACOPIER_VERSION} + exit +fi +echo Version: ${ULTRACOPIER_VERSION} + +echo "Upload version..." +source sub-script/upload-local.sh +cd ${BASE_PWD} +echo "Upload version... done" + + + + |