v0.9.3. DATA_DIR moved to /tmp

This commit is contained in:
gSpot
2022-05-10 01:22:25 +03:00
parent bbfc6595e3
commit fa22fdbe2a
17 changed files with 68 additions and 114 deletions
+1
View File
@@ -32,3 +32,4 @@ config main 'config'
option bllist_enable_idn '0'
option bllist_alt_nslookup '0'
option bllist_alt_dns_addr '8.8.8.8'
option update_at_startup '1'
+16 -6
View File
@@ -1,22 +1,32 @@
#!/bin/sh /etc/rc.common
START=92
START=96
STOP=01
RUAB="/usr/bin/ruantiblock"
APP_NAME="ruantiblock"
APP_EXEC="/usr/bin/${APP_NAME}"
config_load $APP_NAME
start() {
$RUAB start
local update_at_startup
config_get update_at_startup config update_at_startup
$APP_EXEC start
if [ $? -eq 0 -a "$update_at_startup" = "1" ]; then
$APP_EXEC update
else
/etc/init.d/dnsmasq restart
fi
}
stop() {
$RUAB stop
$APP_EXEC stop
}
restart() {
$RUAB restart
$APP_EXEC restart
}
reload() {
$RUAB reload
$APP_EXEC reload
}
@@ -2,9 +2,11 @@
### Настройки ruantiblock ###
### Директория данных (генерируемые конфиги dnsmasq, ipset и пр.)
DATA_DIR="/etc/ruantiblock/var"
DATA_DIR="/tmp/ruantiblock"
### Директория модулей
MODULES_DIR="/usr/libexec/ruantiblock"
### Дополнительный конфиг dnsmasq с FQDN записями блэклиста
DNSMASQ_DATA_FILE="/tmp/dnsmasq.d/ruantiblock.conf"
### Команда для перезапуска dnsmasq
DNSMASQ_RESTART_CMD="/etc/init.d/dnsmasq restart"
### Директория для html-страницы статуса (не используется в OpenWrt)
@@ -1,6 +1,6 @@
AWK_CMD="awk"
UCI_SECTION="ruantiblock.config"
UCI_VARS="proxy_mode proxy_local_clients ipset_clear_sets allowed_hosts_mode allowed_hosts_list if_vpn tor_trans_port tor_allow_udp onion_dns_addr add_user_entries user_entries_dns enable_logging bllist_module bllist_preset bllist_ip_limit bllist_gr_excluded_nets bllist_summarize_ip bllist_summarize_cidr bllist_ip_filter bllist_sd_limit bllist_gr_excluded_sld bllist_fqdn_filter bllist_enable_idn bllist_alt_nslookup bllist_alt_dns_addr"
UCI_VARS="proxy_mode proxy_local_clients ipset_clear_sets allowed_hosts_mode allowed_hosts_list if_vpn tor_trans_port tor_allow_udp onion_dns_addr add_user_entries user_entries_dns enable_logging bllist_module bllist_preset bllist_ip_limit bllist_gr_excluded_nets bllist_summarize_ip bllist_summarize_cidr bllist_ip_filter bllist_sd_limit bllist_gr_excluded_sld bllist_fqdn_filter bllist_enable_idn bllist_alt_nslookup bllist_alt_dns_addr update_at_startup"
eval `uci show "$UCI_SECTION" | $AWK_CMD -F "=" -v UCI_VARS="$UCI_VARS" '
BEGIN {
@@ -1,5 +0,0 @@
#!/bin/sh
_link="/tmp/dnsmasq.d/ruantiblock.conf"
ln -fs $DNSMASQ_DATA_FILE $_link
eval `echo "$DNSMASQ_RESTART_CMD"`
+8 -8
View File
@@ -15,9 +15,10 @@ export LANGUAGE="en"
CONFIG_DIR="/etc/${NAME}"
CONFIG_FILE="${CONFIG_DIR}/${NAME}.conf"
export DATA_DIR="${CONFIG_DIR}/var"
export DATA_DIR="/var/${NAME}"
export MODULES_DIR="/usr/libexec/${NAME}"
### Дополнительный конфиг dnsmasq с FQDN записями блэклиста
export DNSMASQ_DATA_FILE="/var/dnsmasq.d/${NAME}.conf"
### Команда для перезапуска dnsmasq
export DNSMASQ_RESTART_CMD="/etc/init.d/dnsmasq restart"
### Директория для html-страницы статуса (не используется в OpenWrt)
@@ -35,7 +36,7 @@ export IPSET_CLEAR_SETS=0
export ALLOWED_HOSTS_MODE=0
### Список IP адресов хостов для фильтра, через пробел (прим.: 192.168.0.10 192.168.0.15)
export ALLOWED_HOSTS_LIST=""
### VPN интерфейс для правил iptables
### VPN интерфейс для правил маршрутизации
export IF_VPN="tun0"
### Порт транспарентного proxy Tor (параметр TransPort в torrc)
export TOR_TRANS_PORT=9040
@@ -183,7 +184,6 @@ if [ $ENABLE_LOGGING = "1" -a $? -ne 0 ]; then
ENABLE_LOGGING=0
fi
LOGGER_PARAMS="-t `basename $0` -p user.notice"
export DNSMASQ_DATA_FILE="${DATA_DIR}/${NAME}.dnsmasq"
export IP_DATA_FILE="${DATA_DIR}/${NAME}.ip"
export IPSET_ALLOWED_HOSTS="${NAME}_allowed_ip"
export IPSET_IP="${NAME}_ip"
@@ -213,9 +213,9 @@ fi
Help() {
cat << EOF
Usage: `basename $0` start|force-start|stop|destroy|restart|update|force-update|data-files|renew-ipt|status|status-html|--help
Usage: `basename $0` start|force-start|stop|destroy|restart|update|force-update|data-files|status|status-html|help
start : Start
force-start :
force-start : Removing the pid-file before running
stop : Stop
destroy : Stop + destroy ipsets and clear all data files
restart : Restart
@@ -226,7 +226,7 @@ cat << EOF
status : Status & some info
raw-status : Return code: 0 - enabled, 1 - error, 2 - disabled, 3 - starting, 4 - updating
html-info : Return the html-info output
-h|--help : This message
-h|--help|help : This message
Examples:
`basename $0` start
`basename $0` force-start
@@ -288,7 +288,7 @@ AddIptRules() {
}
DelIptRules() {
IptLocalClientsDel
IptLocalClientsDel
IptMainDel
}