Skip to content

Commit

Permalink
feat: automatic configuration system inotify watches & instances values
Browse files Browse the repository at this point in the history
  • Loading branch information
DDSRem committed Feb 7, 2024
1 parent d54a64a commit de9d6a3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,8 @@ function install_resilio() {
echo "${CONFIG_DIR}" > ${DDSREM_CONFIG_DIR}/resilio_config_dir.txt
fi

get_media_dir

INFO "请输入后台管理端口(默认 8888 )"
read -erp "HT_PORT:" HT_PORT
[[ -z "${HT_PORT}" ]] && HT_PORT="8888"
Expand All @@ -1302,7 +1304,14 @@ function install_resilio() {
read -erp "Extra parameters:" extra_parameters
fi

get_media_dir
INFO "是否自动配置系统 inotify watches & instances 的数值 [Y/n](默认 Y)"
read -erp "inotify:" inotify_set
[[ -z "${inotify_set}" ]] && inotify_set="y"
if [[ ${inotify_set} == [Yy] ]]; then
echo fs.inotify.max_user_watches=524288 | tee -a /etc/sysctl.conf
echo fs.inotify.max_user_instances=524288 | tee -a /etc/sysctl.conf
sysctl -p
fi

if [ ! -d "${MEDIA_DIR}"/config_sync ]; then
INFO "复制 config 文件夹到 config_sync 中..."
Expand Down

0 comments on commit de9d6a3

Please sign in to comment.