HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
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 服务已成功卸载"