single html page upload now works tho its akward to use

This commit is contained in:
shockrah 2020-07-21 22:27:23 -07:00
parent daf3f5f65e
commit df79b46e28

View File

@ -11,9 +11,11 @@ _upload_html() {
echo Path must start with ./
exit 1
fi
echo $(pwd)
for f in $@;do
remote_path=${f:1}
echo curl -H "$auth" -F "$remote_path=@$f" $url/api/upload
curl -H "$auth" -F "$remote_path=@$f" $url/api/upload
done
}
@ -42,6 +44,7 @@ Options:
h => Reuploads all the html content
r => Uploads all root html pages
f [FOLDER] => Upload all html in [FOLDER]
s [PATH] => Upload single html page with mirrord path
EOF
}
@ -49,12 +52,13 @@ if [ -z $1 ];then
_help
else
pushd $site > /dev/null
while getopts ':Hhrf:' opt;do
while getopts ':Hhrf:s:' opt;do
case $opt in
H) _help;;
h) _upload_html $(find -name '*.html');; # Upload all html content
r) _upload_html ./*.html;; # Upload all root html pages
f) _upload_html $2/*.html;;# Upload html in the spec'd folder
s) _upload_html $2;;# upload single html page
esac
done
popd > /dev/null