From 9c68fd4813885bdaa1a67ba549fd5cb4778ae271 Mon Sep 17 00:00:00 2001 From: iiiiiii1 <25471406+iiiiiii1@users.noreply.github.com> Date: Sat, 12 May 2018 20:57:15 +0800 Subject: [PATCH] Update socat.sh --- socat.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/socat.sh b/socat.sh index db015f3..2fbef06 100644 --- a/socat.sh +++ b/socat.sh @@ -78,8 +78,7 @@ start_socat(){ nohup socat -T 600 UDP4-LISTEN:${port1},reuseaddr,fork UDP4:${socatip}:${port2} >> /root/socat.log 2>&1 & " >> /etc/rc.d/rc.local chmod +x /etc/rc.d/rc.local - else - if [ -s /etc/rc.local ]; then + elif [ -s /etc/rc.local ]; then sed -i '/exit/d' /etc/rc.local echo "nohup socat TCP4-LISTEN:${port1},reuseaddr,fork TCP4:${socatip}:${port2} >> /root/socat.log 2>&1 & nohup socat -T 600 UDP4-LISTEN:${port1},reuseaddr,fork UDP4:${socatip}:${port2} >> /root/socat.log 2>&1 & @@ -123,7 +122,6 @@ start_socat(){ systemctl enable rc-local >/dev/null 2>&1 systemctl start rc-local >/dev/null 2>&1 fi - fi get_ip sleep 3 echo