mirror of
https://gitee.com/amber-ce/amber-pm
synced 2026-03-26 07:29:52 +08:00
尝试整个主目录进行沙箱
This commit is contained in:
@@ -3,7 +3,29 @@
|
||||
if [[ ! -e "/usr/share/gxde-api" ]] && ! grep -q "Kylin" /etc/os-release; then
|
||||
exit 0 # No needed
|
||||
fi
|
||||
|
||||
function ensure_dir() {
|
||||
local dir="$1"
|
||||
|
||||
# 检查目录是否为空
|
||||
if [ -z "$dir" ]; then
|
||||
echo "错误: 目录路径不能为空"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# 检查目录是否存在
|
||||
if [ ! -d "$dir" ]; then
|
||||
echo "目录 '$dir' 不存在,正在创建..."
|
||||
if mkdir -p "$dir"; then
|
||||
echo "成功创建目录 '$dir'"
|
||||
return 0
|
||||
else
|
||||
echo "错误: 无法创建目录 '$dir'"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
# 函数:检查目录并创建符号链接
|
||||
process_directory() {
|
||||
local source_dir="$1"
|
||||
@@ -18,6 +40,8 @@ process_directory() {
|
||||
fi
|
||||
}
|
||||
|
||||
ensure_dir "/usr/local/share/applications/"
|
||||
ensue_dir "/usr/local/share/icons/"
|
||||
# 处理 applications 目录
|
||||
process_directory "/var/lib/apm/apm/files/ace-env/amber-ce-tools/data-dir/applications/" \
|
||||
"/usr/local/share/applications/" "Applications"
|
||||
|
||||
Reference in New Issue
Block a user