2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 07:57:21 +08:00

feat: 删除网站支持删除数据库

This commit is contained in:
耗子
2024-06-28 02:52:31 +08:00
parent c70758339f
commit 4d76e9286d
10 changed files with 168 additions and 62 deletions

View File

@@ -17,7 +17,7 @@ import (
// Execf 执行 shell 命令
func Execf(shell string, args ...any) (string, error) {
if !CheckArgs(slice.ToString(args)...) {
return "", errors.New("你想干什么?")
return "", errors.New("发现危险的命令参数,中止执行")
}
var cmd *exec.Cmd
@@ -39,7 +39,7 @@ func Execf(shell string, args ...any) (string, error) {
// ExecfAsync 异步执行 shell 命令
func ExecfAsync(shell string, args ...any) error {
if !CheckArgs(slice.ToString(args)...) {
return errors.New("你想干什么?")
return errors.New("发现危险的命令参数,中止执行")
}
var cmd *exec.Cmd
@@ -67,7 +67,7 @@ func ExecfAsync(shell string, args ...any) error {
// ExecfWithTimeout 执行 shell 命令并设置超时时间
func ExecfWithTimeout(timeout time.Duration, shell string, args ...any) (string, error) {
if !CheckArgs(slice.ToString(args)...) {
return "", errors.New("你想干什么?")
return "", errors.New("发现危险的命令参数,中止执行")
}
var cmd *exec.Cmd