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