QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
| Title |
Determining network connectivity (within the sysinit) |
| Ref. No. |
QNX.000009845 |
| Category(ies) |
Network, Configuration |
| Issue |
In QNX4, how can we determine if we are connected to the network and if so do a 'nameloc -k#' and otherwise do a 'nameloc &'?
|
| Solution |
Add the following lines to the sysinit file:
nameloc -k # & sleep 1 i=$(sin in | sed -n 's/.*Locators: //p') > /dev/null if [ "$i" != "" ]; then echo "Network Locator Found" else echo "Starting local locator" nameloc & fi |
|