optimate status check

pull/171/head
233boy 6 years ago
parent c8ff23c9d0
commit b061c9a561
  1. 2
      src/client_file.sh
  2. 6
      src/mtproto.sh
  3. 2
      src/qr.sh
  4. 6
      src/socks.sh
  5. 6
      src/ss-info.sh
  6. 19
      src/status.sh
  7. 9
      src/v2ray-info.sh
  8. 5
      v2ray.sh

@ -1,3 +1,5 @@
_load status.sh
_get_status
_get_client_file() {
local _link="$(cat $v2ray_client_config | tr -d [:space:] | base64 -w0)"
local link="https://233boy.github.io/tools/json.html#${_link}"

@ -6,10 +6,8 @@ _view_mtproto_info() {
fi
}
_mtproto_info() {
if [[ ! $v2ray_pid ]]; then
_load status.sh
_err_msg
fi
_load status.sh
_get_status
[[ -z $ip ]] && get_ip
echo
echo "---------- Telegram MTProto 配置信息 -------------"

@ -1,3 +1,5 @@
_load status.sh
_get_status
_qr_create() {
local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64 -w 0)"
local link="https://233boy.github.io/tools/qr.html#${vmess}"

@ -6,10 +6,8 @@ _view_socks_info() {
fi
}
_socks_info() {
if [[ ! $v2ray_pid ]]; then
_load status.sh
_err_msg
fi
_load status.sh
_get_status
[[ -z $ip ]] && get_ip
echo
echo "---------- Socks 配置信息 -------------"

@ -1,7 +1,5 @@
if [[ ! $v2ray_pid ]]; then
_load status.sh
_err_msg
fi
_load status.sh
_get_status
[[ -z $ip ]] && get_ip
if [[ $shadowsocks ]]; then
#local ss="ss://$(echo -n "${ssciphers}:${sspass}@${ip}:${ssport}" | base64 -w 0)#${_site}_ss_${ip}"

@ -1,19 +1,32 @@
_check_status() {
sleep 2
unset v2ray_pid
if [[ ! $(pgrep -f /usr/bin/v2ray/v2ray) ]]; then
_err_msg
else
v2ray_pid=true
fi
unset caddy_pid
if [[ $v2ray_transport == [45] && $caddy ]] && [[ ! $(pgrep -f /usr/local/bin/caddy) ]]; then
_err_msg "Caddy"
else
caddy_pid=true
fi
}
_get_status() {
if [[ ! $v2ray_pid ]]; then
_err_msg
elif [[ $v2ray_transport == [45] && $caddy ]] && [[ ! $caddy_pid ]]; then
_err_msg "Caddy"
fi
}
_err_msg() {
local str=$1
[[ -z $1 ]] && local str="V2Ray"
echo
_red "警告!!! $str 运行出错!!!! 请检查端口是否冲突!!! 配置是否正确!!!!"
_red "警告!!! $str 运行出错!!!! 请检查端口是否冲突!!! 配置是否正确!!!!"
_red "警告!!! $str 运行出错!!!! 请检查端口是否冲突!!! 配置是否正确!!!!"
_red "警告!!! $str 运行出错!!! 或没有在运行!!!! 请检查!!!!"
_red "警告!!! $str 运行出错!!! 或没有在运行!!!! 请检查!!!!"
_red "警告!!! $str 运行出错!!! 或没有在运行!!!! 请检查!!!!"
echo
exit 1
}

@ -71,13 +71,8 @@ _v2_args() {
}
_v2_info() {
if [[ ! $v2ray_pid ]]; then
_load status.sh
_err_msg
elif [[ $v2ray_transport == [45] && $caddy ]] && [[ ! $caddy_pid ]]; then
_load status.sh
_err_msg "Caddy"
fi
_load status.sh
_get_status
[[ -z $ip ]] && get_ip
echo
echo

@ -2559,6 +2559,9 @@ get_v2ray_config_qr_link() {
}
get_v2ray_multi_vmess_URL_QR() {
_load status.sh
_get_status
echo "---------- V2Ray vmess URL / V2RayNG v0.4.1+ / V2RayN v2.1+ / 仅适合部分客户端 -------------"
get_ip
_load jqcmd.sh
@ -2571,6 +2574,8 @@ get_v2ray_multi_vmess_URL_QR() {
get_v2ray_vmess_URL_link() {
_load status.sh
_get_status
echo
echo "---------- V2Ray vmess URL / V2RayNG v0.4.1+ / V2RayN v2.1+ / 仅适合部分客户端 -------------"
get_ip

Loading…
Cancel
Save