From 4c7a0b9dc7ceef6826869666d6060be80e36e610 Mon Sep 17 00:00:00 2001 From: eaglexiang Date: Wed, 4 Apr 2018 04:45:43 +0800 Subject: [PATCH] update uninstall.sh --- uninstall.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/uninstall.sh b/uninstall.sh index 39f5068..736311c 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -1,10 +1,14 @@ #!/usr/bin/env bash -# bin files -rm -rf /usr/lib/eagle-tunnel -rm -rf /usr/bin/eagle-tunnel -# conf files -rm -rf /etc/eagle-tunnel.conf -rm -rf /etc/eagle-tunnel.d -# systemd unit files -rm -rf /usr/lib/systemd/system/eagle-tunnel-server.service -rm -rf /usr/lib/systemd/system/eagle-tunnel-client.service \ No newline at end of file + +if [ $(whoami) = "root" ]; then + # bin files + rm -rf /usr/lib/eagle-tunnel + rm -rf /usr/bin/eagle-tunnel + # conf files + rm -rf /etc/eagle-tunnel.conf + rm -rf /etc/eagle-tunnel.d + # systemd unit files + rm -rf /usr/lib/systemd/system/eagle-tunnel.service +else + echo "you must excute uninstall operation with root permission." +fi \ No newline at end of file