improve caddy status check

pull/171/head
233boy 6 years ago
parent b061c9a561
commit a5d9332bd9
  1. 2
      src/mtproto.sh
  2. 2
      src/qr.sh
  3. 2
      src/socks.sh
  4. 2
      src/ss-info.sh
  5. 5
      src/status.sh

@ -7,7 +7,7 @@ _view_mtproto_info() {
} }
_mtproto_info() { _mtproto_info() {
_load status.sh _load status.sh
_get_status _get_status 1
[[ -z $ip ]] && get_ip [[ -z $ip ]] && get_ip
echo echo
echo "---------- Telegram MTProto 配置信息 -------------" echo "---------- Telegram MTProto 配置信息 -------------"

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

@ -7,7 +7,7 @@ _view_socks_info() {
} }
_socks_info() { _socks_info() {
_load status.sh _load status.sh
_get_status _get_status 1
[[ -z $ip ]] && get_ip [[ -z $ip ]] && get_ip
echo echo
echo "---------- Socks 配置信息 -------------" echo "---------- Socks 配置信息 -------------"

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

@ -1,5 +1,5 @@
_check_status() { _check_status() {
sleep 2 sleep 1.5
unset v2ray_pid unset v2ray_pid
if [[ ! $(pgrep -f /usr/bin/v2ray/v2ray) ]]; then if [[ ! $(pgrep -f /usr/bin/v2ray/v2ray) ]]; then
_err_msg _err_msg
@ -16,7 +16,8 @@ _check_status() {
_get_status() { _get_status() {
if [[ ! $v2ray_pid ]]; then if [[ ! $v2ray_pid ]]; then
_err_msg _err_msg
elif [[ $v2ray_transport == [45] && $caddy ]] && [[ ! $caddy_pid ]]; then fi
if [[ $v2ray_transport == [45] && $caddy ]] && [[ $1 && ! $caddy_pid ]]; then
_err_msg "Caddy" _err_msg "Caddy"
fi fi
} }

Loading…
Cancel
Save