This commit is contained in:
38
nodejs/uninstall.sh
Normal file
38
nodejs/uninstall.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
slug=${1}
|
||||
node_path="${setup_path}/server/nodejs/${slug}"
|
||||
|
||||
rm -rf ${node_path}
|
||||
rm -f /usr/local/bin/corepack${slug}
|
||||
rm -f /usr/local/bin/node${slug}
|
||||
rm -f /usr/local/bin/npm${slug}
|
||||
rm -f /usr/local/bin/npx${slug}
|
||||
|
||||
if [ -L /usr/local/bin/corepack ]; then
|
||||
link_path=$(readlink /usr/local/bin/corepack)
|
||||
[ "${link_path}" == "${node_path}/bin/corepack" ] && rm -f /usr/local/bin/corepack
|
||||
fi
|
||||
if [ -L /usr/local/bin/node ]; then
|
||||
link_path=$(readlink /usr/local/bin/node)
|
||||
[ "${link_path}" == "${node_path}/bin/node" ] && rm -f /usr/local/bin/node
|
||||
fi
|
||||
if [ -L /usr/local/bin/npm ]; then
|
||||
link_path=$(readlink /usr/local/bin/npm)
|
||||
[ "${link_path}" == "${node_path}/bin/npm" ] && rm -f /usr/local/bin/npm
|
||||
fi
|
||||
if [ -L /usr/local/bin/npx ]; then
|
||||
link_path=$(readlink /usr/local/bin/npx)
|
||||
[ "${link_path}" == "${node_path}/bin/npx" ] && rm -f /usr/local/bin/npx
|
||||
fi
|
||||
|
||||
echo -e $HR
|
||||
echo "Uninstall successful"
|
||||
echo -e $HR
|
||||
Reference in New Issue
Block a user