Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- first_run=${first_run:-false}
- host=${host:-domain.com}
- conf=${conf:-'static_sites.conf'}
- ssh_cmd=${ssh_cmd:-'ssh}'
- curr_user=${curr_user:-'dokku'}
- new_user=${new_user:-'static'}
- if [ ! -z "$new_pass" ]; then
- new_pass=":$new_pass"
- fi
- function first_run_f () {
- # eval "$ssh_cmd $curr_user@$host \"sudo adduser $new_user\""
- eval "$ssh_cmd $curr_user@$host 'sudo touch /etc/nginx/conf.d/static_sites.conf && sudo chown static:static /etc/nginx/conf.d/static_sites.conf'"
- rsync -e "$ssh_cmd" -azP "$conf" "${new_user}${new_pass}@${host}":/etc/nginx/conf.d/static_sites.conf
- eval "$ssh_cmd $host sudo service nginx restart"
- }
- if $first_run; then
- first_run_f
- fi
- rsync -e "$ssh_cmd" -azP web-frontend "${new_user}${new_pass}@${host}":/tmp
- #/home/static/sites/web-frontend
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement