Hi, I've newly installed OpenWrt routers here,
using Opkg extras as advised, and I noticed that opkg restore was not called...
as this was told in this thread
by @NilsRo
recently I tried to create a scrip that use "online" folder of hotplug.d and I noticed it does not work...
/etc/hotplug.d/iface does work however
indeed /etc/hotplug.d/online is not in the documentation , but opkg extras uses it.
is there a clean way to have a "online" event ?
I've tested
/etc/hotplug.d/iface/
which works better
I've made s script like that
[ "$ACTION" = "ifup" -a "$INTERFACE" = "lan" ] && {
logger -t useronline "we are online"
}
/etc/hotplug.d/iface/90-useronline
why not simply calling "online" hotplugs lmyself ?
something like
[ "$ACTION" = "ifup" -a "$INTERFACE" = "lan" ] && {
logger -t useronline "calling online hotplug"
hotplug-call online
}
or maybe something more intelligent that try to reach Internet
Edit: finally I've made a script but immediately after an ifup, Internet is unreachable, even if lan/lan6 is upped (I'm working as dump AP)... I had to sleep, but I'm afraid there is a parallel call...
I had to use touch files in /tmp to avoid multiple call
if [ \( "$ACTION" = "ifup" -o "$ACTION" = "ifupdate" \) -a \! \( "$INTERFACE" = "loopback" \) ] ; then
logger -t hotplugonline "$ACTION $INTERFACE , testing Internet for online hotplug"
for trysleep in 1 2 4 8 16 16 16 ; do
if [ -e /tmp/hotplugonline.mark ] ; then
logger -t hotplugonline "online plugins already called"
break;
else
if wget -O /dev/null --quiet http://connectivitycheck.gstatic.com/generate_204 ; then
logger -t hotplugonline "$ACTION $INTERFACE , calling online hotplug"
touch /tmp/hotplugonline.mark
/sbin/hotplug-call online
break;
else
logger -t hotplugonline "$ACTION $INTERFACE , failed to contact Internet, sleeping $trysleep"
sleep $trysleep
fi
fi
done
fi
NB: I'm new to OpenWrt, maybe is it a well know fact, and I'm missing the point...
I'm using latest OpenWRT OpenWrt 21.02.1 r16325-88151b8303 / LuCI openwrt-21.02 branch git-21.295.67054-13df80d on Netgear WAC104 & WAC124
It's configured as (not so) dumb AP. OPKG extras installed, and few unrelated package (ebtables/netfilter/physdev, samba4, wpad-wolfssl, msmtp)