Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
deb12:tofix [2025/10/02 13:25] – created Bernard Condraudeb12:tofix [2025/10/02 14:33] (current) – [NUT for APC SRV1K] Bernard Condrau
Line 1: Line 1:
 ====== To Fix ====== ====== To Fix ======
 +===== Wait for network =====
 +google: linux bash does not recognize when network comes up
 +  * use ping<code>#!/bin/bash
 +    TARGET_HOST="8.8.8.8"
 +    while ! ping -c 1 "$TARGET_HOST" &> /dev/null; do
 +        echo "Waiting for network connectivity..."
 +        sleep 5 # Wait 5 seconds before retrying
 +    done
 +    echo "Network is up! Continuing with script..."
 +    # Your network-dependent commands here
 +</code>
 +  * check network interface state<code>#!/bin/bash
 +    INTERFACE="eth0" # Replace with your actual interface name
 +    while [[ $(</sys/class/net/${INTERFACE}/operstate) != "up" ]]; do
 +        echo "Waiting for interface $INTERFACE to be up..."
 +        sleep 5
 +    done
 +    echo "Interface $INTERFACE is up! Continuing with script..."
 +    # Your network-dependent commands here
 +</code>
 +google: linux interface up when no router
 +
 +===== NUT for APC SRV1K =====
 +  * [[https://networkupstools.org/docs/man/huawei-ups2000.html|HUAWEI-UPS2000(8)]]
 +  * google "nut with qinheng electronics ch341"
 +  * ''systemctl reload nut-server''
 +  * google "nut driver not connected"
 +  * google "how to create driver for nut in debian 12"