Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:advanced:hotplug_extras [2023/10/03 05:01] – [Examples] replace logger to avoid cutting long lines vgaetera | docs:guide-user:advanced:hotplug_extras [2023/10/03 18:12] – [Instructions] avoid global delay, use delay per script if necessary vgaetera | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| ===== Implementation ===== | ===== Implementation ===== | ||
| - | | + | * Use [[docs: |
| - | | + | |
| * Process subsystem-specific scripts with [[https:// | * Process subsystem-specific scripts with [[https:// | ||
| * Delay script invocation with [[man> | * Delay script invocation with [[man> | ||
| Line 21: | Line 20: | ||
| mkdir -p / | mkdir -p / | ||
| cat << " | cat << " | ||
| - | . / | + | if [ " |
| - | network_flush_cache | + | |
| - | network_find_wan NET_IF | + | |
| - | network_find_wan6 NET_IF6 | + | |
| - | if [ " | + | |
| - | && [ " | + | |
| then exit 0 | then exit 0 | ||
| fi | fi | ||
| Line 42: | Line 36: | ||
| cat << " | cat << " | ||
| / | / | ||
| - | EOF | ||
| - | mkdir -p / | ||
| - | cat << " | ||
| - | sleep 10 | ||
| - | EOF | ||
| - | cat << " | ||
| - | / | ||
| EOF | EOF | ||
| </ | </ | ||
| Line 55: | Line 42: | ||
| <code bash> | <code bash> | ||
| # Example script | # Example script | ||
| - | cat << " | + | cat << " |
| - | echo $(date +%c) ${@} $(env) | + | logger -t hotplug |
| EOF | EOF | ||
| - | reboot | + | / |
| + | logread -e hotplug | ||
| </ | </ | ||