mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-22 06:17:48 +00:00
Uninstall scripts.
This commit is contained in:
parent
165bc589fd
commit
bdc0ed8065
@ -1,17 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
make file2lz4c
|
# This script builds the installer for *nix systems. Windows must do everything
|
||||||
|
# completely differently, as usual.
|
||||||
if [ ! -f file2lz4c ]; then
|
|
||||||
echo "Build of file2lz4c utility failed, aborting installer build."
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f zerotier-one ]; then
|
if [ ! -f zerotier-one ]; then
|
||||||
echo "Could not find 'zerotier-one' binary, please build before running this script."
|
echo "Could not find 'zerotier-one' binary, please build before running this script."
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
make -j 2 file2lz4c
|
||||||
|
if [ ! -f file2lz4c ]; then
|
||||||
|
echo "Build of file2lz4c utility failed, aborting installer build."
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
machine=`uname -m`
|
machine=`uname -m`
|
||||||
system=`uname -s`
|
system=`uname -s`
|
||||||
|
|
||||||
@ -34,6 +36,9 @@ mkdir installer-build
|
|||||||
case "$system" in
|
case "$system" in
|
||||||
|
|
||||||
Linux)
|
Linux)
|
||||||
|
# Canonicalize $machine for some architectures... we use x86
|
||||||
|
# and x64 for Intel stuff. ARM and others should be fine if
|
||||||
|
# we ever ship officially for those.
|
||||||
case "$machine" in
|
case "$machine" in
|
||||||
i386|i486|i586|i686)
|
i386|i486|i586|i686)
|
||||||
machine="x86"
|
machine="x86"
|
||||||
@ -42,9 +47,10 @@ case "$system" in
|
|||||||
machine="x64"
|
machine="x64"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknonwn machine type: $machine"
|
echo "Unsupported machine type: $machine"
|
||||||
exit 2
|
exit 2
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "Assembling Linux installer for $machine and ZT1 version $vmajor.$vminor.$revision"
|
echo "Assembling Linux installer for $machine and ZT1 version $vmajor.$vminor.$revision"
|
||||||
|
|
||||||
./file2lz4c installer/linux/uninstall.sh uninstall_sh >installer-build/uninstall_sh.h
|
./file2lz4c installer/linux/uninstall.sh uninstall_sh >installer-build/uninstall_sh.h
|
||||||
|
@ -37,3 +37,5 @@ echo "as identity.secret and can be manually deleted if you wish. Save it if"
|
|||||||
echo "you wish to re-use the address of this node, as it cannot be regenerated."
|
echo "you wish to re-use the address of this node, as it cannot be regenerated."
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
@ -1,21 +1,38 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||||
|
|
||||||
if [ "$UID" -ne 0 ]; then
|
if [ "$UID" -ne 0 ]; then
|
||||||
echo "Must be run as root; try: sudo ./uninstall.sh"
|
echo "Must be run as root; try: sudo $0"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo "This will uninstall ZeroTier One, hit CTRL+C to abort."
|
||||||
|
echo "Waiting 5 seconds..."
|
||||||
|
sleep 5
|
||||||
|
|
||||||
ztpath="/Library/Application Support/ZeroTier/One"
|
ztpath="/Library/Application Support/ZeroTier/One"
|
||||||
|
|
||||||
echo "Killing any running zerotier-one service..."
|
echo "Killing any running zerotier-one service..."
|
||||||
killall zerotier-one
|
killall -TERM zerotier-one >>/dev/null 2>&1
|
||||||
sleep 5
|
sleep 3
|
||||||
|
killall -KILL zerotier-one >>/dev/null 2>&1
|
||||||
|
|
||||||
|
echo "Unloading kernel extension..."
|
||||||
|
kextunload "$ztpath/tap.kext"
|
||||||
|
|
||||||
echo "Erasing binary and support files..."
|
echo "Erasing binary and support files..."
|
||||||
cd $ztpath
|
cd $ztpath
|
||||||
rm -fv zerotier-one
|
rm -rfv zerotier-one *.persist authtoken.secret identity.public *.log *.pid *.kext
|
||||||
rm -rfv updates.d
|
|
||||||
rm -fv *.persist
|
|
||||||
rm -rfv networks.d
|
|
||||||
rm -fv authtoken.secret
|
|
||||||
|
|
||||||
|
echo "Done."
|
||||||
|
echo
|
||||||
|
echo "Your ZeroTier One identity is still preserved in $ztpath"
|
||||||
|
echo "as identity.secret and can be manually deleted if you wish. Save it if"
|
||||||
|
echo "you wish to re-use the address of this node, as it cannot be regenerated."
|
||||||
|
|
||||||
|
echo
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user