Update README.md

This commit is contained in:
chiu 2020-07-30 20:40:02 +08:00
parent a6a1592697
commit def090cdec
1 changed files with 2 additions and 8 deletions

View File

@ -273,21 +273,15 @@ sig () {
get_orbit_root () { get_orbit_root () {
if [ ! -f $NGINX_ORBIT_SITES/$1 ]; then echo "Site $1 not found" && exit 0; fi if [ ! -f $NGINX_ORBIT_SITES/$1 ]; then echo "Site $1 not found" && exit 0; fi
ORBIT_ROOT=`cat $NGINX_ORBIT_SITES/$1 | grep 'root'`; ORBIT_ROOT=`cat $NGINX_ORBIT_SITES/$1 | grep 'root' | grep -v '#' | xargs | awk '{print $2}'`;
ORBIT_ROOT=${ORBIT_ROOT//"/public;"/""}; ORBIT_ROOT=${ORBIT_ROOT//"/public;"/""};
ORBIT_ROOT=${ORBIT_ROOT//"root"/""};
ORBIT_ROOT=${ORBIT_ROOT//" "/""};
if [ ! -d $ORBIT_ROOT ]; then echo "Site folder $ORBIT_ROOT not fount" && exit 0; fi if [ ! -d $ORBIT_ROOT ]; then echo "Site folder $ORBIT_ROOT not fount" && exit 0; fi
} }
start_orbit () { start_orbit () {
sig 0 $ORBIT_ROOT && echo >&2 "$ORBIT_ROOT Already running" && continue; sig 0 $ORBIT_ROOT && echo >&2 "$ORBIT_ROOT Already running" && continue;
if [ ! -d "$ORBIT_ROOT/public/assets" ]; then
sudo su -l $ORBIT_USER -c "cd $ORBIT_ROOT && git fetch origin && git pull origin master && bundle"
sudo su -l $ORBIT_USER -c "cd $ORBIT_ROOT && bundle exec rake assets:precompile RAILS_ENV=production"
fi
echo "Starting $ORBIT_ROOT"; echo "Starting $ORBIT_ROOT";
sudo su -l $ORBIT_USER -c "cd $ORBIT_ROOT && bundle exec unicorn_rails -D -E $RAILS_ENV -c $ORBIT_ROOT/config/unicorn.rb"; sudo su -l $ORBIT_USER -c "cd $ORBIT_ROOT && bundle exec unicorn_rails -D -E $RAILS_ENV -c config/unicorn.rb";
} }
case $1 in case $1 in