Show pagesourceOld revisionsBacklinksBack to top × Table of Contents Hotplug extras Introduction Features Implementation Instructions Examples Automated Hotplug extras This article relies on the following: Accessing web interface / command-line interface Managing configs / packages / services / logs Introduction This instruction extends the functionality of Hotplug. Follow the automated section for quick setup. Features Run scripts at startup when the network is online. Implementation Use Hotplug to detect connectivity change and trigger network dependent scripts. Process subsystem-specific scripts with hotplug-call. Delay script invocation with sleep to work around tunneled connections. Write and read non-interactive logs with Syslog for troubleshooting. 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 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.OKMore information about cookies Last modified: 2023/10/14 01:44by vgaetera