#!/bin/sh

if [ -f /etc/issue ]
then
    cat /etc/issue | sed -e 's/\\n.\\l//' | tr -s '\n' '\n' | dd bs=100 count=1 2>/dev/null
    exit 0
fi

if [ -x /usr/bin/lsb_release ]
then
    /usr/bin/lsb_release -d
    exit 0
fi

if [ -f /etc/debian_version ]
then
    cat /etc/debian_version
    exit 0
fi

SHELL=`readlink /proc/$$/exe`

if [ "$SHELL" != "${SHELL%busybox*}" ]
then
    echo "busybox system"
    exit 0
fi

echo 'Unsupported distro: cannot determine build version'
