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
@@ -35,7 +35,8 @@ URL_TORRC="https://raw.githubusercontent.com/gSpotx2f/ruantiblock_openwrt/master
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)"
### packages
FILE_RUAB_PKG="${PKG_DIR}/ruantiblock-${RUAB_VERSION}.apk"
FILE_MOD_LUA_PKG="${PKG_DIR}/ruantiblock-mod-lua-${RUAB_MOD_LUA_VERSION}.apk"
@@ -120,7 +121,7 @@ BackupFile() {
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
+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
+3 -2
View File
@@ -35,7 +35,8 @@ URL_TORRC="https://raw.githubusercontent.com/gSpotx2f/ruantiblock_openwrt/master
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)"
### packages
FILE_RUAB_PKG="${PKG_DIR}/ruantiblock_${RUAB_VERSION}_all.ipk"
FILE_MOD_LUA_PKG="${PKG_DIR}/ruantiblock-mod-lua_${RUAB_MOD_LUA_VERSION}_all.ipk"
@@ -120,7 +121,7 @@ BackupFile() {
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
+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