Skip to content

Instantly share code, notes, and snippets.

@weldpua2008
Created August 9, 2018 08:58
Show Gist options
  • Select an option

  • Save weldpua2008/2cf2c14f49b102e4f569efdf44752d38 to your computer and use it in GitHub Desktop.

Select an option

Save weldpua2008/2cf2c14f49b102e4f569efdf44752d38 to your computer and use it in GitHub Desktop.
Get files from github to /etc/nginx
for u in '';do
n=$(echo $u|cut -d '?' -f 1)
while [ ${#n} -gt 0 ] && [[ $(echo $n| awk -F'/' '{print NF-1}') -gt 0 ]];do
n=$(echo $n|sed 's/^[^/]*\///g');
if [[ -e "/etc/nginx/${n}" ]];then
echo "curl ${u} > /etc/nginx/${n}"
curl ${u} > /etc/nginx/${n}
break
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment