diff --git a/packages/bsp/common/etc/update-motd.d/10-armbian-header b/packages/bsp/common/etc/update-motd.d/10-armbian-header index 26e2f3d70d..bc3987e31c 100755 --- a/packages/bsp/common/etc/update-motd.d/10-armbian-header +++ b/packages/bsp/common/etc/update-motd.d/10-armbian-header @@ -13,9 +13,13 @@ THIS_SCRIPT="header" MOTD_DISABLE="" [[ -f /etc/armbian-release ]] && . /etc/armbian-release -[[ -f /etc/armbian-distribution-status ]] && . /etc/armbian-distribution-status -[[ -f /etc/lsb-release && -f /etc/armbian-distribution-status ]] && DISTRIBUTION_CODENAME=$(grep CODENAME /etc/lsb-release | cut -d"=" -f2) && DISTRIBUTION_STATUS=$(grep $DISTRIBUTION_CODENAME /etc/armbian-distribution-status | cut -d"=" -f2) -[[ -f /etc/os-release && -f /etc/armbian-distribution-status ]] && DISTRIBUTION_CODENAME=$(grep VERSION_CODENAME /etc/os-release | cut -d"=" -f2) && DISTRIBUTION_STATUS=$(grep $DISTRIBUTION_CODENAME /etc/armbian-distribution-status | cut -d"=" -f2) +if [[ -f /etc/armbian-distribution-status ]]; then + . /etc/armbian-distribution-status + [[ -f /etc/lsb-release ]] && DISTRIBUTION_CODENAME=$(grep CODENAME /etc/lsb-release | cut -d"=" -f2) + [[ -z "$DISTRIBUTION_CODENAME" && -f /etc/os-release ]] && DISTRIBUTION_CODENAME=$(grep VERSION_CODENAME /etc/os-release | cut -d"=" -f2) + [[ -z "$DISTRIBUTION_CODENAME" && -x /usr/bin/lsb_release ]] && DISTRIBUTION_CODENAME=$(/usr/bin/lsb_release -c | cut -d":" -f2 | tr -d "\t") + DISTRIBUTION_STATUS=$(grep "$DISTRIBUTION_CODENAME" /etc/armbian-distribution-status | cut -d"=" -f2) +fi [[ -f /etc/default/armbian-motd ]] && . /etc/default/armbian-motd for f in $MOTD_DISABLE; do