Fix bug.
This commit is contained in:
parent
dfcc4fb852
commit
39414f747d
13
move_site.sh
13
move_site.sh
|
@ -20,6 +20,9 @@ if [[ ! -z "$9" ]]; then
|
|||
new_server_name="$(echo "$9"|sed 's/:.\+//g')";
|
||||
if [[ ! -z "$(echo "$9"|grep ':')" ]]; then
|
||||
new_server_port="$(echo "$9"|sed 's/[^:]\+://g')";
|
||||
if [[ -z "$new_server_port" ]]; then
|
||||
new_server_port="80";
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
domain_escape=`echo $domain|sed 's/\./\\\./g'`;
|
||||
|
@ -39,8 +42,8 @@ else
|
|||
use_local_command=""
|
||||
fi
|
||||
nginx_file=`$ssh_command "grep -e $'\s''$domain_escape' /etc/nginx/orbit_sites/* -l"|xargs|awk '{print $1}'`;
|
||||
remote_sudo_command="echo $pass|sudo -S -p ''"
|
||||
alias sudo_command="echo $user_pass|sudo -S -p ''"
|
||||
remote_sudo_command="echo $pass|sudo -S -p ' '"
|
||||
alias sudo_command="echo $user_pass|sudo -S -p ' '"
|
||||
if [ -z "$(which sshpass)" ]; then
|
||||
sudo_command apt install sshpass -y;
|
||||
fi
|
||||
|
@ -158,10 +161,14 @@ else
|
|||
echo "Nginx setting has some problem!";
|
||||
echo "Please restart nginx by yourself!";
|
||||
fi
|
||||
rm -f Gemfile.lock
|
||||
bundle install
|
||||
rm -f tmp/unicorn.sock tmp/pids/unicorn.pid
|
||||
bundle exec unicorn_rails -c config/unicorn.rb -E production
|
||||
wget http://gitlab.tp.rulingcom.com/erictyl/install_r45_on_ubuntu_1804lts_doc/-/raw/master/start_site.sh -O start_site.sh
|
||||
wget http://gitlab.tp.rulingcom.com/erictyl/install_r45_on_ubuntu_1804lts_doc/-/raw/master/close_site.sh -O close_site.sh
|
||||
bash ./start_site.sh production
|
||||
echo "Finish moving and installing site!"
|
||||
echo "Site Path: $local_store_path"
|
||||
exit_command 0;
|
||||
fi
|
||||
fi
|
|
@ -25,6 +25,9 @@ if [[ ! -z "$tmp" ]]; then
|
|||
new_server_name="$(echo "$tmp"|sed 's/:.\+//g')";
|
||||
if [[ ! -z "$(echo "$tmp"|grep ':')" ]]; then
|
||||
new_server_port="$(echo "$tmp"|sed 's/[^:]\+://g')";
|
||||
if [[ -z "$new_server_port" ]]; then
|
||||
new_server_port="80";
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
tmp="";
|
||||
|
@ -45,8 +48,8 @@ else
|
|||
use_local_command=""
|
||||
fi
|
||||
nginx_file=`$ssh_command "grep -e $'\s''$domain_escape' /etc/nginx/orbit_sites/* -l"|xargs|awk '{print $1}'`;
|
||||
remote_sudo_command="echo $pass|sudo -S -p ''"
|
||||
alias sudo_command="echo $user_pass|sudo -S -p ''"
|
||||
remote_sudo_command="echo $pass|sudo -S -p ' '"
|
||||
alias sudo_command="echo $user_pass|sudo -S -p ' '"
|
||||
if [ -z "$(which sshpass)" ]; then
|
||||
sudo_command apt install sshpass -y;
|
||||
fi
|
||||
|
@ -164,10 +167,14 @@ else
|
|||
echo "Nginx setting has some problem!";
|
||||
echo "Please restart nginx by yourself!";
|
||||
fi
|
||||
rm -f Gemfile.lock
|
||||
bundle install
|
||||
rm -f tmp/unicorn.sock tmp/pids/unicorn.pid
|
||||
bundle exec unicorn_rails -c config/unicorn.rb -E production
|
||||
wget http://gitlab.tp.rulingcom.com/erictyl/install_r45_on_ubuntu_1804lts_doc/-/raw/master/start_site.sh -O start_site.sh
|
||||
wget http://gitlab.tp.rulingcom.com/erictyl/install_r45_on_ubuntu_1804lts_doc/-/raw/master/close_site.sh -O close_site.sh
|
||||
bash ./start_site.sh production
|
||||
echo "Finish moving and installing site!"
|
||||
echo "Site Path: $local_store_path"
|
||||
exit_command 0;
|
||||
fi
|
||||
fi
|
Loading…
Reference in New Issue