添加 rm-frpc.sh
This commit is contained in:
parent
2735798ba1
commit
f8c063a74e
40
rm-frpc.sh
Normal file
40
rm-frpc.sh
Normal file
@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 定义变量
|
||||
INSTALL_DIR="/usr/local/bin"
|
||||
SERVICE_NAME="frpc"
|
||||
CONFIG_DIR="/etc/frp"
|
||||
FRPC_BIN="$INSTALL_DIR/frpc"
|
||||
SERVICE_FILE="/etc/systemd/system/$SERVICE_NAME.service"
|
||||
|
||||
# 停止并禁用服务
|
||||
if systemctl is-active --quiet $SERVICE_NAME; then
|
||||
echo "正在停止 $SERVICE_NAME 服务..."
|
||||
sudo systemctl stop $SERVICE_NAME
|
||||
fi
|
||||
|
||||
if systemctl is-enabled --quiet $SERVICE_NAME; then
|
||||
echo "正在禁用 $SERVICE_NAME 服务..."
|
||||
sudo systemctl disable $SERVICE_NAME
|
||||
fi
|
||||
|
||||
# 删除 Systemd 服务文件
|
||||
if [ -f "$SERVICE_FILE" ]; then
|
||||
echo "正在删除 Systemd 服务文件..."
|
||||
sudo rm -f $SERVICE_FILE
|
||||
sudo systemctl daemon-reload
|
||||
fi
|
||||
|
||||
# 删除 frpc 可执行文件
|
||||
if [ -f "$FRPC_BIN" ]; then
|
||||
echo "正在删除 frpc 可执行文件..."
|
||||
sudo rm -f $FRPC_BIN
|
||||
fi
|
||||
|
||||
# 删除配置文件目录
|
||||
if [ -d "$CONFIG_DIR" ]; then
|
||||
echo "正在删除配置文件目录..."
|
||||
sudo rm -rf $CONFIG_DIR
|
||||
fi
|
||||
|
||||
echo "frpc 卸载完成!"
|
Loading…
x
Reference in New Issue
Block a user