Fixed autoinstall.

This commit is contained in:
gSpot
2025-12-25 03:39:34 +03:00
parent f660d8c616
commit 75724ed7c0
4 changed files with 12 additions and 8 deletions
+3 -2
View File
@@ -7,7 +7,8 @@ PREFIX=""
CONFIG_DIR="${PREFIX}/etc/ruantiblock"
USER_LISTS_DIR="${CONFIG_DIR}/user_lists"
EXEC_DIR="${PREFIX}/usr/bin"
BACKUP_DIR="${CONFIG_DIR}/autoinstall.bak.$(date +%s)"
BACKUP_DIR_BASE="${CONFIG_DIR}/autoinstall.bak"
BACKUP_DIR="${BACKUP_DIR_BASE}.$(date +%s)"
HTDOCS_VIEW="${PREFIX}/www/luci-static/resources/view"
HTDOCS_RUAB="${HTDOCS_VIEW}/ruantiblock"
CRONTAB_FILE="/etc/crontabs/root"
@@ -61,7 +62,7 @@ RemoveFile() {
BackupCurrentConfig() {
local _file
MakeDir "$BACKUP_DIR"
for _file in $(ls -1 "$CONFIG_DIR" | grep -v "$(basename $BACKUP_DIR)")
for _file in $(ls -1 "$CONFIG_DIR" | grep -v "$(basename $BACKUP_DIR_BASE)*")
do
cp -af "${CONFIG_DIR}/${_file}" "${BACKUP_DIR}/${_file}"
done