Skip to content

Commit

Permalink
Update Version
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Oct 15, 2021
1 parent b1765dd commit d9dd45f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
9 changes: 9 additions & 0 deletions docker/v2ray/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/bin/bash

UPTIME=`cat /proc/uptime |awk '{print $1}'`
if [[ `echo "$UPTIME < 100"|bc` -eq 1 ]];then
LOCAL_IP=`curl -s http://api.ipify.org 2>/dev/null`
if [[ -e /root/.iptables ]];then
[[ `echo $LOCAL_IP|grep :` ]] && IPTABLE_WAY="ip6tables" || IPTABLE_WAY="iptables"
$IPTABLE_WAY-restore -c < /root/.iptables
fi
fi

if [[ ! -e /etc/v2ray ]];then
mkdir /etc/v2ray
v2ray new >/dev/null 2>&1
Expand Down
9 changes: 9 additions & 0 deletions docker/xray/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/bin/bash

UPTIME=`cat /proc/uptime |awk '{print $1}'`
if [[ `echo "$UPTIME < 100"|bc` -eq 1 ]];then
LOCAL_IP=`curl -s http://api.ipify.org 2>/dev/null`
if [[ -e /root/.iptables ]];then
[[ `echo $LOCAL_IP|grep :` ]] && IPTABLE_WAY="ip6tables" || IPTABLE_WAY="iptables"
$IPTABLE_WAY-restore -c < /root/.iptables
fi
fi

if [[ ! -e /etc/xray ]];then
mkdir /etc/xray
xray new >/dev/null 2>&1
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
]
)
12 changes: 12 additions & 0 deletions v2ray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ removeV2Ray() {
rm -rf /etc/bash_completion.d/v2ray.bash >/dev/null 2>&1
rm -rf /usr/local/bin/v2ray >/dev/null 2>&1
rm -rf /etc/v2ray_util >/dev/null 2>&1
rm -rf /etc/profile.d/iptables.sh >/dev/null 2>&1
rm -rf /root/.iptables >/dev/null 2>&1

#删除v2ray定时更新任务
crontab -l|sed '/SHELL=/d;/v2ray/d'|sed '/SHELL=/d;/xray/d' > crontab.txt
Expand Down Expand Up @@ -162,6 +164,16 @@ installDependent(){
updateProject() {
[[ ! $(type pip 2>/dev/null) ]] && colorEcho $RED "pip no install!" && exit 1

if [[ -e /etc/v2ray_util && ! -e /etc/profile.d/iptables.sh ]];then
LOCAL_IP=`curl -s http://api.ipify.org 2>/dev/null`
[[ `echo $LOCAL_IP|grep :` ]] && IPTABLE_WAY="ip6tables" || IPTABLE_WAY="iptables"
cat > /etc/profile.d/iptables.sh << EOF
#!/bin/bash
$IPTABLE_WAY-restore -c < /root/.iptables
EOF
chmod +x /etc/profile.d/iptables.sh
fi

pip install -U v2ray_util

if [[ -e $UTIL_PATH ]];then
Expand Down
2 changes: 1 addition & 1 deletion v2ray_util/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '3.10.5.3'
__version__ = '3.10.6'

import sys
if "xray" in sys.argv[0]:
Expand Down

0 comments on commit d9dd45f

Please sign in to comment.