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 [2021/04/13 02:14] – [Implementation] wording vgaetera | docs:guide-user:advanced:hotplug_extras [2023/10/03 18:12] – [Instructions] avoid global delay, use delay per script if necessary vgaetera | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Hotplug extras ====== | ====== Hotplug extras ====== | ||
| - | {{section> | + | {{section> |
| ===== Introduction ===== | ===== Introduction ===== | ||
| - | * This instruction extends [[docs: | + | * This instruction extends |
| - | * Follow [[docs: | + | |
| - | * Follow [[docs: | + | |
| * Follow the [[docs: | * Follow the [[docs: | ||
| Line 12: | Line 10: | ||
| ===== Implementation ===== | ===== Implementation ===== | ||
| - | * Rely on [[https:// | + | * Use [[docs: |
| - | * Use [[docs: | + | * Process subsystem-specific scripts with [[https:// |
| * Delay script invocation with [[man> | * Delay script invocation with [[man> | ||
| * Write and read non-interactive logs with [[docs: | * Write and read non-interactive logs with [[docs: | ||
| Line 22: | Line 20: | ||
| mkdir -p / | mkdir -p / | ||
| cat << " | cat << " | ||
| - | . / | + | if [ " |
| - | network_flush_cache | + | then exit 0 |
| - | network_find_wan NET_IF | + | |
| - | network_find_wan6 NET_IF6 | + | |
| - | if [ " | + | |
| - | && [ " | + | |
| - | then for FILE in / | + | |
| - | do . " | + | |
| - | done | logger -t hotplug-online | + | |
| fi | fi | ||
| + | if [ " | ||
| + | && [ " | ||
| + | then exit 0 | ||
| + | fi | ||
| + | if [ " | ||
| + | && [ -z " | ||
| + | && [ -z " | ||
| + | then exit 0 | ||
| + | fi | ||
| + | hotplug-call online | ||
| EOF | EOF | ||
| cat << " | cat << " | ||
| / | / | ||
| - | EOF | ||
| - | mkdir -p / | ||
| - | cat << " | ||
| - | sleep 10 | ||
| - | EOF | ||
| - | cat << " | ||
| - | / | ||
| EOF | EOF | ||
| </ | </ | ||
| Line 47: | Line 41: | ||
| ===== Examples ===== | ===== Examples ===== | ||
| <code bash> | <code bash> | ||
| - | # Check hotplug | + | # Example script |
| + | cat << " | ||
| + | logger -t hotplug $(env) | ||
| + | EOF | ||
| + | / | ||
| logread -e hotplug | logread -e hotplug | ||
| </ | </ | ||
| Line 53: | Line 51: | ||
| ===== Automated ===== | ===== Automated ===== | ||
| <code bash> | <code bash> | ||
| - | opkg update | + | wget -U "" |
| - | opkg install libustream-mbedtls | + | |
| - | uclient-fetch | + | |
| . ./ | . ./ | ||
| </ | </ | ||