Hotplug extras

  • This instruction extends Hotplug functionality.
  • Follow Opkg extras to extend Opkg functionality.
  • Follow UCI extras to extend UCI functionality.
  • Follow the automated section for quick setup.
  • Run scripts at startup when the network is online.
  • Rely on network functions to identify WAN interface.
  • Use Hotplug to detect WAN connectivity and trigger network dependent scripts.
  • Delay script invocation with sleep to work around tunneled connections.
  • Write and read non-interactive logs with Syslog for troubleshooting.
# Configure hotplug
mkdir -p /etc/hotplug.d/iface
cat << "EOF" > /etc/hotplug.d/iface/90-online
. /lib/functions/
network_find_wan NET_IF
network_find_wan6 NET_IF6
if [ "${INTERFACE}" = "${NET_IF}" -o "${INTERFACE}" = "${NET_IF6}" ] \
&& [ "${ACTION}" = "ifup" -o "${ACTION}" = "ifupdate" ]
then for FILE in /etc/hotplug.d/online/*
do . "${FILE}" 2>&1
done | logger -t hotplug-online
cat << "EOF" >> /etc/sysupgrade.conf
mkdir -p /etc/hotplug.d/online
cat << "EOF" > /etc/hotplug.d/online/30-sleep
sleep 10
cat << "EOF" >> /etc/sysupgrade.conf
# Check hotplug log
logread -e hotplug
opkg update
opkg install libustream-mbedtls
uclient-fetch -O ""
. ./
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2021/04/13 02:14
  • by vgaetera