Skip to content

Commit

Permalink
Merge pull request #3089 from herbetom/v2022.1.x-patches
Browse files Browse the repository at this point in the history
[v2022.1.x]: backport patches
  • Loading branch information
blocktrron committed Dec 6, 2023
2 parents 9092d1a + 6aff3d1 commit 1d0a30f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 38 deletions.
8 changes: 4 additions & 4 deletions modules
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
GLUON_FEEDS='packages routing gluon'
GLUON_FEEDS='gluon packages routing'

OPENWRT_REPO=https://github.com/openwrt/openwrt.git
OPENWRT_BRANCH=openwrt-22.03
OPENWRT_COMMIT=1f7ca927b788c180135b7708138e94386bb958b4

PACKAGES_GLUON_REPO=https://github.com/freifunk-gluon/packages.git
PACKAGES_GLUON_COMMIT=ce2e6ac1937af9a4c5c54181ab00781a0bf0097c

PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git
PACKAGES_PACKAGES_BRANCH=openwrt-22.03
PACKAGES_PACKAGES_COMMIT=e34369a41b522a49dec9fb1d81b4ee6b32b731d8

PACKAGES_ROUTING_REPO=https://github.com/openwrt/routing.git
PACKAGES_ROUTING_BRANCH=openwrt-22.03
PACKAGES_ROUTING_COMMIT=777c115b0a6336d6582c5992d25b631b6d6d21fd

PACKAGES_GLUON_REPO=https://github.com/freifunk-gluon/packages.git
PACKAGES_GLUON_COMMIT=29912ec6308fd10b47763b4cf28a638d07f59973
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ local function restart_tunneldigger()
os.execute('/etc/init.d/tunneldigger restart')
end

local function read_pid_file()
local pid_file = io.open('/var/run/tunneldigger.mesh-vpn.pid', 'r')
if not pid_file then
return nil
end
local pid = pid_file:read('*l')
pid_file:close()
return pid
end

local function has_mesh_vpn_neighbours()
local handle = io.popen('batctl o', 'r')
if not handle then
Expand All @@ -33,11 +23,6 @@ local function has_mesh_vpn_neighbours()
end

if uci:get_bool('tunneldigger', 'mesh_vpn', 'enabled') then
if io.popen('pgrep -x /usr/bin/tunneldigger'):read('*l') ~= read_pid_file() then
os.execute('logger -t tunneldigger-watchdog "Process-Pid does not match with pid-File."')
restart_tunneldigger()
return
end
if not has_mesh_vpn_neighbours() then
os.execute('logger -t tunneldigger-watchdog "No vpn-mesh neighbours found."')
restart_tunneldigger()
Expand Down
26 changes: 8 additions & 18 deletions package/gluon-wan-dnsmasq/files/etc/init.d/gluon-wan-dnsmasq
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,18 @@

START=60

SERVICE_NAME=gluon-wan-dnsmasq
SERVICE_USE_PID=1
SERVICE_PID_FILE=/var/run/gluon-wan-dnsmasq.pid


PORT=54
PACKET_MARK=1
USE_PROCD=1

RESOLV_CONF_DIR=/var/gluon/wan-dnsmasq
RESOLV_CONF=$RESOLV_CONF_DIR/resolv.conf


start() {
start_service() {
mkdir -p $RESOLV_CONF_DIR
/lib/gluon/wan-dnsmasq/update.lua

export LD_PRELOAD=libpacketmark.so
export LIBPACKETMARK_MARK=$PACKET_MARK

service_start /usr/sbin/dnsmasq -x $SERVICE_PID_FILE -u root -i lo -p $PORT -h -r $RESOLV_CONF
}
touch "$RESOLV_CONF"

stop() {
service_stop /usr/sbin/dnsmasq
procd_open_instance
procd_set_param command /usr/sbin/dnsmasq -u root -i lo -p 54 -h -k -c 0 -r $RESOLV_CONF
procd_set_param env LD_PRELOAD=libpacketmark.so LIBPACKETMARK_MARK=1
procd_set_param respawn 60 5 5
procd_close_instance
}
2 changes: 1 addition & 1 deletion scripts/modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[ ! -f "$GLUON_SITEDIR"/modules ] || . "$GLUON_SITEDIR"/modules

# shellcheck disable=SC2086
FEEDS="$(echo $GLUON_FEEDS $GLUON_SITE_FEEDS | tr ' ' '\n')"
FEEDS="$(echo $GLUON_SITE_FEEDS $GLUON_FEEDS | tr ' ' '\n')"

GLUON_MODULES=openwrt

Expand Down

0 comments on commit 1d0a30f

Please sign in to comment.