#!/bin/bash
BOLD=$(tput bold)
NORMAL=$(tput sgr0)
DINIT_VER=$(dinit --version | grep version)

if test -e /etc/issue.net; then
 OS_VER=$(cat /etc/issue.net)
else
 OS_VER=init-diversity
fi

cat /etc/issue | grep Debian > /dev/null
if [ $? -eq 0 ]; then
  OS=Debian
fi

cat /etc/issue | grep Ubuntu > /dev/null
if [ $? -eq 0 ]; then
  OS=Ubuntu
fi

cat /etc/issue | grep Devuan > /dev/null
if [ $? -eq 0 ]; then
  OS=Devuan
fi

if test -e /etc/antix-version; then
 OS=antiX
else
  OS=init-diversity
fi

echo ""
echo "${BOLD}Welcome to $OS GNU/Linux!${NORMAL}"
echo "${BOLD}$DINIT_VER${NORMAL} is now booting up ${BOLD}$OS_VER${NORMAL}"
echo ""
