From 3f1ce51dc49d82046288d9420bc24db1ca97e00d Mon Sep 17 00:00:00 2001 From: HITSword Date: Thu, 5 Mar 2020 16:30:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=B8=E8=BD=BD=E5=A2=9E=E5=8A=A0=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: HITSword --- uninstall.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/uninstall.sh b/uninstall.sh index 2917070..5b49245 100644 --- a/uninstall.sh +++ b/uninstall.sh @@ -10,9 +10,17 @@ rm -rf /usr/local/udptools echo "删除相关服务" #判断服务模式 if pgrep systemd-journal; then - find /usr/lib/systemd/system/ -name "udp2raw*.service" | xargs -0 rm - find /usr/lib/systemd/system/ -name "udpspeeder*.service" | xargs -0 rm + if ls /usr/lib/systemd/system/ | grep -q -e "udp2raw*.service"; then + find /usr/lib/systemd/system/ -name "udp2raw*.service" | xargs -0 rm + fi + if ls /usr/lib/systemd/system/ | grep -q -e "udpspeeder*.service"; then + find /usr/lib/systemd/system/ -name "udpspeeder*.service" | xargs -0 rm + fi else - find /etc/init.d/ -name "udp2raw*" | xargs -0 rm - find /etc/init.d/ -name "udpspeeder*" | xargs -0 rm + if ls /etc/init.d/ | grep -q -e "udp2raw*"; then + find /etc/init.d/ -name "udp2raw*" | xargs -0 rm + fi + if ls /etc/init.d/ | grep -q -e "udpspeeder*"; then + find /etc/init.d/ -name "udpspeeder*" | xargs -0 rm + fi fi \ No newline at end of file