~禁止安装到tmp|opt|sys等目录

This commit is contained in:
juewuy
2025-02-09 13:11:50 +08:00
parent 767c20bd73
commit fcc146ab43
2 changed files with 2 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ setdir() {
df -h | awk '{print $6,$4}' | sed 1d
echo '路径是必须带 / 的格式,注意写入虚拟内存(/tmp,/opt,/sys...)的文件会在重启后消失!!!'
read -p "请输入自定义路径 > " dir
if [ "$(dir_avail $dir)" = 0 ]; then
if [ "$(dir_avail $dir)" = 0 ] || [ -n "$(echo $dir |grep -E 'tmp|opt|sys')" ]; then
echo "\033[31m路径错误请重新设置\033[0m"
set_cust_dir
fi