Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2014-03-27 23:50:15 +0000
committershtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2014-03-27 23:50:15 +0000
commit80d38d9c6bd6f48ea1a58b9db10795cea73380e6 (patch)
tree9adaae60a0f0cb364018d834bbde58bd3d786127
parent6703a275de25f5937245c41a6634ce8ecdf5a749 (diff)
[scripts] Add cURL download function and use by default.
git-svn-id: svn+ssh://scm.narf.ssji.net/svn/shtrom/scripts@1778 1991c358-8f32-0410-a49a-990740bdf4c2
-rwxr-xr-xcloud_backup.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/cloud_backup.sh b/cloud_backup.sh
index 3ef4bbc..60314ea 100755
--- a/cloud_backup.sh
+++ b/cloud_backup.sh
@@ -29,12 +29,24 @@ function wgetit() {
${SITE_PASS:+--password=${SITE_PASS}}
}
+function curlit() {
+ SITE=$1
+ DATE=$2
+ SITE_URL=$3
+ SITE_USER=$4
+ SITE_PASS=$5
+ SITE_POST=$6
+ curl -A "$0" -k -s -o ${SITE}.${DATE} \
+ ${SITE_URL} ${SITE_POST:+--d ${SITE_POST}} \
+ ${SITE_USER:+--user ${SITE_USER}:${SITE_PASS}}
+}
+
for SITE in ${SITES}; do
eval SITE_URL=\$${SITE}_URL
eval SITE_USER=\$${SITE}_USER
eval SITE_PASS=\$${SITE}_PASS
eval SITE_POST=\$${SITE}_POST
- wgetit "$SITE" "$DATE" "$SITE_URL" "$SITE_USER" "$SITE_PASS" "$SITE_POST"
+ curlit "$SITE" "$DATE" "$SITE_URL" "$SITE_USER" "$SITE_PASS" "$SITE_POST"
RET=$?
if [ $RET != 0 -o ! -s ${SITE}.${DATE} ];then
echo "$0: An error occurred with site ${SITE}: ret=${RET}"