tink-access-one/access-one.install
2026-01-09 01:19:17 +08:00

36 lines
874 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

stop_process(){
echo "checking running process..."
processName="AOne"
if pgrep -x "$processName" >/dev/null; then
echo "$processName is running,stopping..."
killall -e $processName
fi
}
stop_service(){
echo "checking running service..."
serviceName="aone.service"
num=`systemctl status $serviceName|grep "Active"|grep "running"|wc -l`
if [ $num -ne 0 ]; then
echo "$serviceName is running,stopping..."
systemctl stop $serviceName
systemctl disable $serviceName
fi
}
pre_install(){
stop_service
stop_process
}
post_install(){
bash /opt/AOne/control-scripts/postinst
}
pre_remove(){
bash /opt/AOne/control-scripts/prerm
bash /opt/AOne/control-scripts/postrm
}
post_remove(){
stop_service
stop_process
rm -rf /etc/systemd/system/aone.service
rm -rf /opt/AOne
}