Missing $ on auth vars
This commit is contained in:
parent
53653387ed
commit
6fcc5216a6
16
upload.sh
16
upload.sh
@ -1,11 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ ! -z $CI_COMMIT_BRANCH ];then
|
||||
echo Gitlab CI Detected!
|
||||
echo export KEY=$NEOCITIES_KEY >> .env
|
||||
fi
|
||||
|
||||
if [ ! -z .env ];then
|
||||
# no env means we have to use the neocities var
|
||||
export KEY=$NEOCITIES_KEY
|
||||
else
|
||||
source .env
|
||||
fi
|
||||
|
||||
url="https://neocities.org"
|
||||
site=.mirror
|
||||
@ -21,7 +21,7 @@ _upload_html() {
|
||||
for f in $@;do
|
||||
remote_path=${f:1}
|
||||
echo curl -s -o /dev/null -w '%{http_code}' -H "auth" -F "$remote_path=@$f" $url/api/upload
|
||||
curl -s -o /dev/null -w '%{http_code}' -H "auth" -F "$remote_path=@$f" $url/api/upload
|
||||
curl -s -o /dev/null -w '%{http_code}' -H "$auth" -F "$remote_path=@$f" $url/api/upload
|
||||
done
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ _upload_media() {
|
||||
for f in $@;do
|
||||
remote_path=${f:1}
|
||||
echo curl -s -o /dev/null -w '%{http_code}' -H "auth" -F "$remote_path=@$f" $url/api/upload
|
||||
curl -s -o /dev/null -w '%{http_code}' -H "auth" -F "$remote_path=@$f" $url/api/upload
|
||||
curl -s -o /dev/null -w '%{http_code}' -H "$auth" -F "$remote_path=@$f" $url/api/upload
|
||||
done
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ if [ -z $1 ];then
|
||||
_help
|
||||
else
|
||||
pushd $site > /dev/null
|
||||
while getopts ':Hhrf:s:m:M' opt;do
|
||||
while getopts 'a::Hhrf:s:m:M' opt;do
|
||||
case $opt in
|
||||
H) _help;;
|
||||
h) _upload_html $(find -name '*.html');; # Upload all html content
|
||||
|
Loading…
Reference in New Issue
Block a user