代码拉取完成,页面将自动刷新
同步操作将从 jc3wish/Bifrost 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/sh
#Copyright [2018] [jc3wish]
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#http://www.apache.org/licenses/LICENSE-2.0
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
bin_dir=
pid_file=
config_file=
dir_dir=
mode=$1 # start or stop or restart
basepath=$(cd `dirname $0`;pwd)
basepathParent=$(dirname $basepath)
__readINI () {
INIFILE=$1; SECTION=$2; ITEM=$3;
_readIni=`cat $INIFILE | awk 'BEGIN{FS="=";OFS=":";}/\'$SECTION'\]/,/\[.*[^('$SECTION')].*\]/{gsub(/[[:blank:]]*/,"",$1);if(NF==2 && $1=="'$ITEM'"){gsub(/^[[:blank:]]*/,"",$2);gsub(/[[:blank:]]*$/,"",$2);print $2;}}'`
echo "${_readIni}"
}
if test -z "$bin_dir"
then
bin_dir="$basepath"
fi
if test -z "$config_file"
then
config_file="$basepathParent/etc/Bifrost.ini"
fi
if test -z "$dir_dir"
then
dir_dir=$(__readINI $config_file Bifrostd data_dir);
fi
if test -z "$dir_dir"
then
dir_dir="$basepathParent/data"
fi
if [[ $dir_dir != /* ]]; then
dir_dir=$basepathParent"/"$dir_dir
fi
if test -z "$pid_file"
then
pid_file=$(__readINI $config_file Bifrostd pid);
fi
if test -z "$pid_file"
then
pid_file="$dir_dir/Bifrost.pid"
fi
case "$mode" in
'start')
# Start daemon
#echo "Starting Bifrost"
if test -x $bin_dir/Bifrost
then
$bin_dir/Bifrost -d -config $config_file -pid $pid_file
else
echo "Couldn't find Bifrost server ($bin_dir/Bifrost)"
exit 1
fi
exit 0
;;
'stop')
# Stop daemon. We use a signal here to avoid having to know the
if test -s "$pid_file"
then
bifrost_pid=`cat "$pid_file"`
if (kill -0 $bifrost_pid 2>/dev/null)
then
echo "Shutting down Bifrost"
kill $bifrost_pid
for i in 1 2 3
do
sleep 1
if !(kill -0 $bifrost_pid 2>/dev/null)
then
echo "server stop success"
exit 0
fi
done
echo "kill $bifrost_pid failed, retry please"
exit 1
else
echo "Bifrost server process #$bifrost_pid is not running!"
rm "$pid_file"
exit 1
fi
exit 0
else
echo "Bifrost server PID file could not be found!"
exit 1
fi
;;
'restart')
# Stop the service and regardless of whether it was
# running or not, start it again.
if ($0 stop); then
$0 start
else
echo "Failed to stop running server, so refusing to try to start."
exit 1
fi
;;
'status')
# First, check to see if pid file exists
if test -s "$pid_file" ; then
bifrost_pid=`cat "$pid_file"`
if kill -0 $bifrost_pid 2>/dev/null ; then
echo "Bifrost running ($bifrost_pid)"
exit 0
else
echo "Bifrost is not running, but PID file exists"
exit 1
fi
else
echo "PID file not exists"
exit 1
fi
;;
*)
# usage
basename=`basename "$0"`
echo "Usage: $basename {start|stop|restart|status} [ Bifrost server options ]"
exit 1
;;
esac
exit 0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。