Skip to content

Commit

Permalink
Show running Docker containers in the MOTD
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Feb 8, 2025
1 parent 7901e1b commit 03ac47c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/bsp/common/etc/update-motd.d/10-armbian-header
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ if [[ $NUM_UPDATES -gt 0 ]]; then
UPDATE_STATUS+=" available for upgrade\e[0m "
fi

# read running Docker containers if any
if systemctl is-active docker >/dev/null; then
CONTAINERS_STATUS=$(docker ps --format "{{.Names}}" | tr '\n' ',' | sed 's/,/, /g' | sed 's/, $//')
fi

echo ""

# Display packages status
Expand All @@ -160,6 +165,11 @@ if [[ -n $wan_ip_address ]]; then
echo -e "\x1B[93m(WAN)\x1B[0m $wan_ip_address"
fi

# Display running docker containers
if [[ -n "${CONTAINERS_STATUS}" ]]; then
echo -e " Containers: \x1B[92m$CONTAINERS_STATUS\x1B[0m"
fi

# Display hostapd
if [[ -n $ssid ]]; then
echo -e " WiFi AP: SSID: (\x1B[91m$ssid\x1B[0m), $(iw $interface info | grep channel | xargs)"
Expand Down

0 comments on commit 03ac47c

Please sign in to comment.