一个卸载阿里云安骑士的脚本。

分享一个挖矿,写了一个卸载阿里云安骑士的脚本。
uninstall.sh(aim at aliyun aegis)

#!/bin/bash

#check linux Gentoo os
var=lsb_release -a | grep Gentoo
if [ -z “${var}” ]; then
var=cat /etc/issue | grep Gentoo
fi

if [ -d “/etc/runlevels/default” -a -n “${var}” ]; then
LINUX_RELEASE=“GENTOO”
else
LINUX_RELEASE=“OTHER”
fi

stop_aegis(){
killall -9 aegis_cli >/dev/null 2>&1
killall -9 aegis_update >/dev/null 2>&1
killall -9 aegis_cli >/dev/null 2>&1
killall -9 AliYunDun >/dev/null 2>&1
killall -9 AliHids >/dev/null 2>&1
killall -9 AliYunDunUpdate >/dev/null 2>&1
printf “%-40s %40s\n” “Stopping aegis” “[ OK ]”
}

remove_aegis(){
if [ -d /usr/local/aegis ];then
rm -rf /usr/local/aegis/aegis_client
rm -rf /usr/local/aegis/aegis_update
rm -rf /usr/local/aegis/alihids
fi
}

uninstall_service() {

if [ -f “/etc/init.d/aegis” ]; then
/etc/init.d/aegis stop >/dev/null 2>&1
rm -f /etc/init.d/aegis
fi

if [ KaTeX parse error: Expected 'EOF', got '&' at position 171: …" >/dev/null 2>&̲1; fi elif [ -f…{var}.d/" ];then
rm -f “/etc/rc v a r . d / S 80 a e g i s " e l i f [ − d " / e t c / r c . d / r c {var}.d/S80aegis" elif [ -d "/etc/rc.d/rc var.d/S80aegis"elif[d"/etc/rc.d/rc{var}.d” ];then
rm -f “/etc/rc.d/rc${var}.d/S80aegis”
fi
done
fi

}

stop_aegis
uninstall_service
remove_aegis
umount /usr/local/aegis/aegis_debug

printf “%-40s %40s\n” “Uninstalling aegis” “[ OK ]”

只要想法够多,连自己都能干掉。

你可能感兴趣的:(一个卸载阿里云安骑士的脚本。)