Fixed POST_UPDATE_SCRIPT.

This commit is contained in:
gSpot
2025-07-25 21:32:01 +03:00
parent 212ec22d7a
commit 1c27840aca
7 changed files with 17 additions and 574 deletions
+2 -2
View File
@@ -10,9 +10,9 @@ LUCI_APP=1
HTTPS_DNS_PROXY=1
OWRT_VERSION="current"
RUAB_VERSION="2.1.6-r2"
RUAB_VERSION="2.1.6-r3"
RUAB_MOD_LUA_VERSION="2.1.6-r1"
RUAB_LUCI_APP_VERSION="2.1.6-r2"
RUAB_LUCI_APP_VERSION="2.1.6-r3"
BASE_URL="https://raw.githubusercontent.com/gSpotx2f/packages-openwrt/master"
PKG_DIR="/tmp"
-411
View File
@@ -1,411 +0,0 @@
#!/bin/sh
PREFIX=""
TOR_USER="tor"
PROXY_MODE=1
BLACKLIST=0
LUA_MODULE=0
LUCI_APP=1
OWRT_VERSION="current"
RUAB_VERSION="1.6.0-1"
RUAB_MOD_LUA_VERSION="1.6.0-1"
RUAB_LUCI_APP_VERSION="1.6.0-r1"
BASE_URL="https://raw.githubusercontent.com/gSpotx2f/packages-openwrt/master"
PKG_DIR="/tmp"
if [ -n "$1" ]; then
OWRT_VERSION="$1"
fi
### URLs
### packages
URL_RUAB_PKG="${BASE_URL}/${OWRT_VERSION}/ruantiblock_${RUAB_VERSION}_all.ipk"
URL_MOD_LUA_PKG="${BASE_URL}/${OWRT_VERSION}/ruantiblock-mod-lua_${RUAB_MOD_LUA_VERSION}_all.ipk"
URL_LUCI_APP_PKG="${BASE_URL}/${OWRT_VERSION}/luci-app-ruantiblock_${RUAB_LUCI_APP_VERSION}_all.ipk"
URL_LUCI_APP_RU_PKG="${BASE_URL}/${OWRT_VERSION}/luci-i18n-ruantiblock-ru_${RUAB_LUCI_APP_VERSION}_all.ipk"
### tor
URL_TORRC="https://raw.githubusercontent.com/gSpotx2f/ruantiblock_openwrt/master/tor/etc/tor/torrc"
### ruantiblock-mod-lua
#URL_LUA_IPTOOL="https://raw.githubusercontent.com/gSpotx2f/iptool-lua/master/5.1/iptool.lua"
URL_LUA_IDN="https://raw.githubusercontent.com/haste/lua-idn/master/idn.lua"
### Local files
RUAB_CFG_DIR="${PREFIX}/etc/ruantiblock"
EXEC_DIR="${PREFIX}/usr/bin"
BACKUP_DIR="${RUAB_CFG_DIR}/autoinstall.bak.`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"
FILE_LUCI_APP_PKG="${PKG_DIR}/luci-app-ruantiblock_${RUAB_LUCI_APP_VERSION}_all.ipk"
FILE_LUCI_APP_RU_PKG="${PKG_DIR}/luci-i18n-ruantiblock-ru_${RUAB_LUCI_APP_VERSION}_all.ipk"
### ruantiblock
FILE_CONFIG="${RUAB_CFG_DIR}/ruantiblock.conf"
FILE_FQDN_FILTER="${RUAB_CFG_DIR}/fqdn_filter"
FILE_IP_FILTER="${RUAB_CFG_DIR}/ip_filter"
FILE_USER_ENTRIES="${RUAB_CFG_DIR}/user_entries"
FILE_BYPASS_ENTRIES="${RUAB_CFG_DIR}/bypass_entries"
FILE_GR_EXCLUDED_SLD="${RUAB_CFG_DIR}/gr_excluded_sld"
FILE_GR_EXCLUDED_NETS="${RUAB_CFG_DIR}/gr_excluded_nets"
FILE_UCI_CONFIG="${PREFIX}/etc/config/ruantiblock"
FILE_INIT_SCRIPT="${PREFIX}/etc/init.d/ruantiblock"
FILE_MAIN_SCRIPT="${EXEC_DIR}/ruantiblock"
### tor
FILE_TORRC="${PREFIX}/etc/tor/torrc"
### ruantiblock-mod-lua
#FILE_LUA_IPTOOL="${PREFIX}/usr/lib/lua/iptool.lua"
FILE_LUA_IDN="${PREFIX}/usr/lib/lua/idn.lua"
AWK_CMD="awk"
WGET_CMD=`which wget`
if [ $? -ne 0 ]; then
echo " Error! wget doesn't exists" >&2
exit 1
fi
WGET_PARAMS="--no-check-certificate -q -O "
OPKG_CMD=`which opkg`
if [ $? -ne 0 ]; then
echo " Error! opkg doesn't exists" >&2
exit 1
fi
UCI_CMD=`which uci`
if [ $? -ne 0 ]; then
echo " Error! uci doesn't exists" >&2
exit 1
fi
FileExists() {
test -e "$1"
}
MakeDir() {
[ -d "$1" ] || mkdir -p "$1"
if [ $? -ne 0 ]; then
echo "Error! Can't create directory (${1})" >&2
exit 1
fi
}
ChmodExec() {
chmod 755 "$1"
}
RemoveFile() {
if [ -e "$1" ]; then
echo "Removing ${1}"
rm -f "$1"
fi
}
DlFile() {
local _dir _file
if [ -n "$2" ]; then
_dir=`dirname "$2"`
MakeDir "$_dir"
_file="$2"
else
_file="-"
fi
$WGET_CMD $WGET_PARAMS "$_file" "$1"
if [ $? -ne 0 ]; then
echo "Connection error (${1})" >&2
exit 1
fi
echo "Downloading ${1}"
}
BackupFile() {
[ -e "$1" ] && cp -f "$1" "${1}.bak.`date +%s`"
}
BackupCurrentConfig() {
local _file
MakeDir "$BACKUP_DIR"
for _file in "$FILE_CONFIG" "$FILE_FQDN_FILTER" "$FILE_IP_FILTER" "$FILE_USER_ENTRIES" "$FILE_BYPASS_ENTRIES" "$FILE_GR_EXCLUDED_NETS" "$FILE_GR_EXCLUDED_SLD" "$FILE_UCI_CONFIG" "$FILE_TORRC"
do
[ -e "$_file" ] && cp -f "$_file" "${BACKUP_DIR}/`basename ${_file}`"
done
}
RunAtStartup() {
$FILE_INIT_SCRIPT enable
}
AppStop() {
FileExists "$FILE_MAIN_SCRIPT" && $FILE_MAIN_SCRIPT destroy
}
AppStart() {
$FILE_INIT_SCRIPT start
}
SetCronTask() {
echo "0 3 */3 * * ${FILE_MAIN_SCRIPT} update" >> /etc/crontabs/root
/etc/init.d/cron restart 2> /dev/null
/etc/init.d/cron enable
}
Reboot() {
reboot
}
UpdatePackagesList() {
$OPKG_CMD update
}
InstallPackages() {
local _pkg
for _pkg in $@
do
if [ -z "`$OPKG_CMD list-installed $_pkg`" ]; then
$OPKG_CMD --force-overwrite install $_pkg
if [ $? -ne 0 ]; then
echo "Error during installation of the package (${_pkg})" >&2
exit 1
fi
fi
done
}
InstallBaseConfig() {
_return_code=1
InstallPackages "dnsmasq-full"
RemoveFile "$FILE_RUAB_PKG" > /dev/null
DlFile "$URL_RUAB_PKG" "$FILE_RUAB_PKG" && $OPKG_CMD install "$FILE_RUAB_PKG" > /dev/null
_return_code=$?
# костыль для остановки сервиса, который запускается автоматически после установки пакета!
AppStop
return $_return_code
}
EnableBlacklist() {
$UCI_CMD set ruantiblock.config.bllist_preset="ruantiblock-fqdn"
$UCI_CMD commit ruantiblock
}
InstallVPNConfig() {
local _if_vpn
$UCI_CMD set ruantiblock.config.proxy_mode="2"
$UCI_CMD set ruantiblock.config.if_vpn="tun0"
$UCI_CMD commit ruantiblock
}
InstallTPConfig() {
local _if_vpn
$UCI_CMD set ruantiblock.config.proxy_mode="3"
$UCI_CMD commit ruantiblock
}
TorrcSettings() {
local _lan_ip=`$UCI_CMD get network.lan.ipaddr | $AWK_CMD -F "/" '{print $1}'`
if [ -z "$_lan_ip" ]; then
_lan_ip="0.0.0.0"
fi
$AWK_CMD -v lan_ip="$_lan_ip" -v TOR_USER="$TOR_USER" '{
if($0 ~ /^([#]?TransPort|[#]?TransListenAddress|[#]?SOCKSPort)/ && $0 !~ "127.0.0.1") sub(/([0-9]{1,3}.){3}[0-9]{1,3}/, lan_ip, $0);
else if($0 ~ /^User/) $2 = TOR_USER;
print $0;
}' "$FILE_TORRC" > "${FILE_TORRC}.tmp" && mv -f "${FILE_TORRC}.tmp" "$FILE_TORRC"
}
InstallTorConfig() {
InstallPackages "tor" "tor-geoip"
BackupFile "$FILE_TORRC"
DlFile "$URL_TORRC" "$FILE_TORRC"
TorrcSettings
$UCI_CMD set ruantiblock.config.proxy_mode="1"
$UCI_CMD commit ruantiblock
$UCI_CMD add_list dhcp.@dnsmasq[0].rebind_domain='onion'
$UCI_CMD commit dhcp
}
InstallLuaModule() {
InstallPackages "lua" "luasocket" "luasec" "luabitop"
RemoveFile "$FILE_MOD_LUA_PKG" > /dev/null
DlFile "$URL_MOD_LUA_PKG" "$FILE_MOD_LUA_PKG" && $OPKG_CMD install "$FILE_MOD_LUA_PKG"
#FileExists "$FILE_LUA_IPTOOL" || DlFile "$URL_LUA_IPTOOL" "$FILE_LUA_IPTOOL"
FileExists "$FILE_LUA_IDN" || DlFile "$URL_LUA_IDN" "$FILE_LUA_IDN"
$UCI_CMD set ruantiblock.config.bllist_module="/usr/libexec/ruantiblock/ruab_parser.lua"
$UCI_CMD commit ruantiblock
}
InstallLuciApp() {
RemoveFile "$FILE_LUCI_APP_PKG" > /dev/null
RemoveFile "$FILE_LUCI_APP_RU_PKG" > /dev/null
DlFile "$URL_LUCI_APP_PKG" "$FILE_LUCI_APP_PKG" && $OPKG_CMD install "$FILE_LUCI_APP_PKG" && \
DlFile "$URL_LUCI_APP_RU_PKG" "$FILE_LUCI_APP_RU_PKG" && $OPKG_CMD install "$FILE_LUCI_APP_RU_PKG"
rm -f /tmp/luci-modulecache/* /tmp/luci-indexcache*
/etc/init.d/rpcd restart
/etc/init.d/uhttpd restart
}
PrintBold() {
printf "\033[1m - ${1}\033[0m\n"
}
InputError () {
printf "\033[1;31m Wrong input! Try again...\033[m\n"; $1
}
ConfirmProxyMode() {
local _reply
printf " Select configuration [ 1: Tor | 2: VPN | 3: Transparent proxy ] (default: 1, quit: q) > "
read _reply
case $_reply in
1|"")
PROXY_MODE=1
break
;;
2)
PROXY_MODE=2
break
;;
3)
PROXY_MODE=3
break
;;
q|Q)
printf "Bye...\n"; exit 0
;;
*)
InputError ConfirmProxyMode
;;
esac
}
ConfirmBlacklist() {
local _reply
printf " Select blacklist [ 1: User entries only | 2: Full blacklist ] (default: 1, quit: q) > "
read _reply
case $_reply in
1|"")
BLACKLIST=1
break
;;
2)
BLACKLIST=2
break
;;
q|Q)
printf "Bye...\n"; exit 0
;;
*)
InputError ConfirmBlacklist
;;
esac
}
ConfirmLuaModule() {
local _reply
printf " Would you like to install the lua module? [ y | n ] (default: y, quit: q) > "
read _reply
case $_reply in
y|Y|"")
LUA_MODULE=1
break
;;
n|N)
LUA_MODULE=0
break
;;
q|Q)
printf "Bye...\n"; exit 0
;;
*)
InputError ConfirmLuaModule
;;
esac
}
ConfirmLuciApp() {
local _reply
printf " Would you like to install the LuCI application? [ y | n ] (default: y, quit: q) > "
read _reply
case $_reply in
y|Y|"")
LUCI_APP=1
break
;;
n|N)
LUCI_APP=0
break
;;
q|Q)
printf "Bye...\n"; exit 0
;;
*)
InputError ConfirmLuciApp
;;
esac
}
ConfirmProcessing() {
local _reply
printf " Next, the installation will begin... Continue? [ y | n ] (default: y, quit: q) > "
read _reply
case $_reply in
y|Y|"")
break
;;
n|N|q|Q)
printf "Bye...\n"; exit 0
;;
*)
InputError ConfirmLuciApp
;;
esac
}
ConfirmProxyMode
ConfirmBlacklist
#ConfirmLuaModule
ConfirmLuciApp
ConfirmProcessing
AppStop
PrintBold "Updating packages list..."
UpdatePackagesList
PrintBold "Saving current configuration..."
#BackupCurrentConfig
PrintBold "Installing basic configuration..."
InstallBaseConfig
if [ $? -eq 0 ]; then
if [ $PROXY_MODE = 2 ]; then
PrintBold "Installing VPN configuration..."
InstallVPNConfig
elif [ $PROXY_MODE = 3 ]; then
PrintBold "Installing transparent proxy configuration..."
InstallTPConfig
else
PrintBold "Installing Tor configuration..."
InstallTorConfig
if `/etc/init.d/tor enabled`; then
/etc/init.d/tor restart
fi
fi
if [ $BLACKLIST = 2 ]; then
PrintBold "Set full blacklist..."
EnableBlacklist
fi
if [ $LUA_MODULE = 1 ]; then
PrintBold "Installing lua module..."
InstallLuaModule
fi
if [ $LUCI_APP = 1 ]; then
PrintBold "Installing luci app..."
InstallLuciApp
fi
RunAtStartup
SetCronTask
else
PrintBold "An error occurred while installing the ruantiblock package!"
fi
exit 0
-149
View File
@@ -1,149 +0,0 @@
#!/bin/sh
PREFIX=""
### Local files
RUAB_CFG_DIR="${PREFIX}/etc/ruantiblock"
EXEC_DIR="${PREFIX}/usr/bin"
BACKUP_DIR="${RUAB_CFG_DIR}/autoinstall.bak.`date +%s`"
HTDOCS_VIEW="${PREFIX}/www/luci-static/resources/view"
HTDOCS_RUAB="${HTDOCS_VIEW}/ruantiblock"
CRONTAB_FILE="/etc/crontabs/root"
DATA_DIR="/tmp/ruantiblock"
DNSMASQ_DATA_FILE="/tmp/dnsmasq.d/02-ruantiblock.dnsmasq"
DNSMASQ_DATA_FILE_TMP="${DNSMASQ_DATA_FILE}.tmp"
DNSMASQ_DATA_FILE_BYPASS="/tmp/dnsmasq.d/01-ruantiblock_bypass.dnsmasq"
SCRIPTS_DIR="/usr/share/ruantiblock"
MODULES_DIR="/usr/libexec/ruantiblock"
### ruantiblock
FILE_CONFIG="${RUAB_CFG_DIR}/ruantiblock.conf"
FILE_FQDN_FILTER="${RUAB_CFG_DIR}/fqdn_filter"
FILE_IP_FILTER="${RUAB_CFG_DIR}/ip_filter"
FILE_USER_ENTRIES="${RUAB_CFG_DIR}/user_entries"
FILE_BYPASS_ENTRIES="${RUAB_CFG_DIR}/bypass_entries"
FILE_GR_EXCLUDED_SLD="${RUAB_CFG_DIR}/gr_excluded_sld"
FILE_GR_EXCLUDED_NETS="${RUAB_CFG_DIR}/gr_excluded_nets"
FILE_UCI_CONFIG="${PREFIX}/etc/config/ruantiblock"
FILE_INIT_SCRIPT="${PREFIX}/etc/init.d/ruantiblock"
FILE_MAIN_SCRIPT="${EXEC_DIR}/ruantiblock"
### tor
FILE_TORRC="${PREFIX}/etc/tor/torrc"
AWK_CMD="awk"
OPKG_CMD=`which opkg`
if [ $? -ne 0 ]; then
echo " Error! opkg doesn't exists" >&2
exit 1
fi
FileExists() {
test -e "$1"
}
MakeDir() {
[ -d "$1" ] || mkdir -p "$1"
if [ $? -ne 0 ]; then
echo "Error! Can't create directory (${1})" >&2
exit 1
fi
}
RemoveFile() {
if [ -e "$1" ]; then
echo "Removing ${1}"
rm -f "$1"
fi
}
BackupCurrentConfig() {
local _file
MakeDir "$BACKUP_DIR"
for _file in "$FILE_CONFIG" "$FILE_FQDN_FILTER" "$FILE_IP_FILTER" "$FILE_USER_ENTRIES" "$FILE_BYPASS_ENTRIES" "$FILE_GR_EXCLUDED_NETS" "$FILE_GR_EXCLUDED_SLD" "$FILE_UCI_CONFIG" "$FILE_TORRC"
do
[ -e "$_file" ] && cp -f "$_file" "${BACKUP_DIR}/`basename ${_file}`"
done
}
AppStop() {
FileExists "$FILE_MAIN_SCRIPT" && $FILE_MAIN_SCRIPT destroy
}
DisableStartup() {
FileExists "$FILE_INIT_SCRIPT" && $FILE_INIT_SCRIPT disable
}
RemoveCronTask() {
if [ -e "$CRONTAB_FILE" ]; then
$AWK_CMD -v FILE_MAIN_SCRIPT="$FILE_MAIN_SCRIPT" '$0 !~ FILE_MAIN_SCRIPT {
print $0;
}' "$CRONTAB_FILE" > "${CRONTAB_FILE}.tmp" && mv -f "${CRONTAB_FILE}.tmp" "$CRONTAB_FILE"
/etc/init.d/cron restart
fi
}
RestoreTorConfig() {
[ -e "${FILE_TORRC}.bak" ] && mv -f "${FILE_TORRC}.bak" "$FILE_TORRC"
if [ -x "/etc/init.d/tor" ]; then
if `/etc/init.d/tor enabled`; then
/etc/init.d/tor restart
fi
fi
}
RemoveAppFiles() {
RestoreTorConfig
$OPKG_CMD remove ruantiblock-mod-py ruantiblock-mod-lua luci-i18n-ruantiblock-ru luci-app-ruantiblock ruantiblock
RemoveFile "$FILE_UCI_CONFIG"
RemoveFile "$FILE_CONFIG"
RemoveFile "$FILE_FQDN_FILTER"
RemoveFile "$FILE_IP_FILTER"
RemoveFile "$FILE_USER_ENTRIES"
RemoveFile "$FILE_BYPASS_ENTRIES"
RemoveFile "$FILE_GR_EXCLUDED_SLD"
RemoveFile "$FILE_GR_EXCLUDED_NETS"
RemoveFile "${FILE_UCI_CONFIG}.opkg"
RemoveFile "${FILE_CONFIG}.opkg"
RemoveFile "${FILE_FQDN_FILTER}.opkg"
RemoveFile "${FILE_IP_FILTER}.opkg"
RemoveFile "${FILE_USER_ENTRIES}.opkg"
RemoveFile "${FILE_BYPASS_ENTRIES}.opkg"
rm -f "$DNSMASQ_DATA_FILE"
rm -f "$DNSMASQ_DATA_FILE_BYPASS"
rm -rf "$DATA_DIR"/*
rmdir "$SCRIPTS_DIR" "$MODULES_DIR" 2> /dev/null
rmdir "$HTDOCS_RUAB" 2> /dev/null
rm -f /tmp/luci-modulecache/* /tmp/luci-indexcache*
/etc/init.d/rpcd restart
/etc/init.d/uhttpd restart
}
InputError () {
printf "\033[1;31m Wrong input! Try again...\033[m\n"; $1
}
ConfirmRemove() {
local _reply
printf " Application will be removed... Continue? [y|n] (default: y, quit: q) > "
read _reply
case $_reply in
y|Y|"")
break
;;
n|N|q|Q)
printf "Bye...\n"; exit 0
;;
*)
InputError ConfirmRemove
;;
esac
}
ConfirmRemove
AppStop
BackupCurrentConfig
DisableStartup
RemoveCronTask
RemoveAppFiles
exit 0
+1 -1
View File
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ruantiblock
PKG_VERSION:=2.1.6
PKG_RELEASE:=2
PKG_RELEASE:=3
LUCI_TITLE:=LuCI support for ruantiblock
LUCI_DEPENDS:=+ruantiblock
LUCI_PKGARCH:=all
@@ -217,10 +217,13 @@ return baseclass.extend({
'lpr' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'lpr')),
'news' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'news')),
'uucp' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'uucp')),
'cron' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'cron')),
'authpriv': E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'authpriv')),
'ftp' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'ftp')),
'ntp' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'ntp')),
'log' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'log')),
'security': E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'security')),
'console' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'console')),
'clock' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'clock')),
'local0' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'local0')),
'local1' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'local1')),
+1 -1
View File
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ruantiblock
PKG_VERSION:=2.1.6
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
include $(INCLUDE_DIR)/package.mk
+10 -10
View File
@@ -205,8 +205,8 @@ export CONFIG_SCRIPT_USER_INSTANCES="${SCRIPTS_DIR}/config_script_user_instances
BLLIST_SOURCES_SCRIPT="${SCRIPTS_DIR}/blacklist_sources"
### Event scripts
START_SCRIPT="${MODULES_DIR}/start_script"
STOP_SCRIPT="${MODULES_DIR}/stop_script"
POST_START_SCRIPT="${MODULES_DIR}/post_start_script"
POST_STOP_SCRIPT="${MODULES_DIR}/post_stop_script"
PRE_UPDATE_SCRIPT="${MODULES_DIR}/pre_update_script"
POST_UPDATE_SCRIPT="${MODULES_DIR}/post_update_script"
@@ -1104,9 +1104,9 @@ Update() {
MakeLogRecord "err" "${_arg} - Error! Another instance of update is already running"
_return_code=2
else
### Pre-update script
[ -x "$PRE_UPDATE_SCRIPT" ] && $PRE_UPDATE_SCRIPT > /dev/null 2>&1 &
ToggleUPIDFile add
### Pre-update script
[ -x "$PRE_UPDATE_SCRIPT" ] && $PRE_UPDATE_SCRIPT
echo " ${NAME} ${_arg}..."
MakeLogRecord "notice" "${_arg}..."
if [ "$NFTSET_CLEAR_SETS" = "1" ]; then
@@ -1118,8 +1118,8 @@ Update() {
_return_code=$?
RestartDnsmasq
ToggleUPIDFile del
### Pre-update script
[ -x "$POST_UPDATE_SCRIPT" ] && $POST_UPDATE_SCRIPT > /dev/null 2>&1 &
### Post-update script
[ -x "$POST_UPDATE_SCRIPT" ] && $POST_UPDATE_SCRIPT &
fi
MakeToken
return $_return_code
@@ -1150,8 +1150,8 @@ Start() {
$ROUTE_CHECK_EXEC start &> /dev/null &
fi
MakeInstancesCache
### Start-script
[ -x "$START_SCRIPT" ] && $START_SCRIPT > /dev/null 2>&1 &
### Post-start script
[ -x "$POST_START_SCRIPT" ] && $POST_START_SCRIPT &
fi
rm -f "$START_PID_FILE"
MakeToken
@@ -1169,8 +1169,8 @@ Stop() {
if [ -x "$ROUTE_CHECK_EXEC" ]; then
$ROUTE_CHECK_EXEC stop &> /dev/null
fi
### Stop-script
[ -x "$STOP_SCRIPT" ] && $STOP_SCRIPT > /dev/null 2>&1 &
### Post-stop script
[ -x "$POST_STOP_SCRIPT" ] && $POST_STOP_SCRIPT &
MakeToken
else
echo " ${NAME} does not running" >&2