Yetixx
Yetixx
Server: nginx/1.28.0
System: Linux instance-rr9enuui 6.1.0-15-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.66-1 (2023-12-09) x86_64
User: www (1000)
PHP: 8.0.26
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/server/site_total/scripts/uninstall.sh
#!/bin/bash

# 检查是否以root权限运行
if [ "$EUID" -ne 0 ]; then
  echo "请使用root权限运行此脚本"
  exit 1
fi

# 设置变量
SERVICE_NAME="site_total"
SERVICE_FILE="/etc/systemd/system/${SERVICE_NAME}.service"

# 检查服务是否存在
if [ ! -f "$SERVICE_FILE" ]; then
  echo "服务文件 $SERVICE_FILE 不存在,可能服务未安装"
  exit 1
fi

# 停止并禁用服务
echo "停止 $SERVICE_NAME 服务..."
systemctl stop "$SERVICE_NAME"
echo "禁用 $SERVICE_NAME 服务..."
systemctl disable "$SERVICE_NAME"

# 删除服务文件
echo "删除服务文件..."
rm -f "$SERVICE_FILE"

# 重新加载systemd配置
systemctl daemon-reload



# 删除nginx配置文件
echo "删除nginx配置文件..."
rm -f /www/server/panel/vhost/nginx/extension/*/site_total.conf

# 重载nginx
echo "重载nginx..."
/www/server/nginx/sbin/nginx -s reload

echo "$SERVICE_NAME 服务已成功卸载"