Table of Contents

Hotplug extras

Introduction

Features

Implementation

Instructions

# Configure hotplug
mkdir -p /etc/hotplug.d/iface
cat << "EOF" > /etc/hotplug.d/iface/90-online
if [ "${INTERFACE}" = "loopback" ]
then exit 0
fi
if [ "${ACTION}" != "ifup" ] \
&& [ "${ACTION}" != "ifupdate" ]
then exit 0
fi
if [ "${ACTION}" = "ifupdate" ] \
&& [ -z "${IFUPDATE_ADDRESSES}" ] \
&& [ -z "${IFUPDATE_DATA}" ]
then exit 0
fi
hotplug-call online
EOF
cat << "EOF" >> /etc/sysupgrade.conf
/etc/hotplug.d/iface/90-online
EOF

Examples

# Example Hotplug script
cat << "EOF" > /etc/hotplug.d/online/00-logger
logger -t hotplug $(env)
EOF
 
# Trigger Hotplug
service network restart
 
# Check Hotplug log
logread -e hotplug

Automated

wget -U "" -O hotplug-extras.sh "https://openwrt.org/_export/code/docs/guide-user/advanced/hotplug_extras?codeblock=0"
. ./hotplug-extras.sh