#!/bin/sh
VERSION="$(cat /etc/ampliphy-version | head -n1 | awk '{print $2}')"
CODENAME="$(cat /etc/ampliphy-version | head -n1 | awk '{print $3}'|sed 's/(\|)//g')"


case $1 in
"-v")
	echo "No LSB modules are available."
	;;
"-i")
	if [ "$2" = "-s" ] ; then
		echo "ampliPHY"
	else
		echo "Distributor ID: ampliPHY"
	fi
	;;
"-is")
	echo "ampliPHY"
	;;
"-si")
	echo "ampliPHY"
	;;
"-ir")
	echo "Distributor ID: ampliPHY"
	echo "Release:        $VERSION"
	;;
"-irc")
	echo "Distributor ID: ampliPHY"
	echo "Release:        $VERSION"
	echo "Codename:       $CODENAME"
	;;
"-d")
	echo "Description:    ampliPHY GNU/Linux $VERSION ($CODENAME)"
	;;
"-ds")
	echo "ampliPHY GNU/Linux $VERSION ($CODENAME)"
	;;
"-sd")
	echo "ampliPHY GNU/Linux $VERSION ($CODENAME)"
	;;
"-r")
	if [ "$2" = "-s" ] ; then
		echo "$VERSION"
	else
		echo "Release:        $VERSION"
	fi
	;;
"-sr")
	echo "$VERSION"
	;;
"-ri")
	echo "Release:        $VERSION"
	echo "Distributor ID: ampliPHY"
	;;
"-c")
	if [ "$2" = "-s" ] ; then
		echo "$CODENAME"
	else
		echo "Codename:       $CODENAME"
	fi
	;;
"-a")
	echo "Distributor ID: ampliPHY"
	echo "Description:    ampliPHY GNU/Linux $VERSION ($CODENAME)"
	echo "Release:        $VERSION" 
	echo "Codename:       $CODENAME"
	;;
"-s")
	echo "No LSB modules are available."
	;;
"-sc")
	echo "$CODENAME"
	;;
*)
	echo "Usage: lsb_release [options]"
	echo ""
	echo "Options:"
	echo "  -h, --help         show this help message and exit"
	echo "  -v, --version      show LSB modules this system supports"
	echo "  -i, --id           show distributor ID"
	echo "  -d, --description  show description of this distribution"
	echo "  -r, --release      show release number of this distribution"
	echo "  -c, --codename     show code name of this distribution"
	echo "  -a, --all          show all of the above information"
	echo "  -s, --short        show requested information in short format"
;;
esac
