#! /bin/bash
#
# splinux_u - Run a parallel Linux installation
# Copyright (c) 2010 Nebil Reyhani
#
# This file is part of splinux.
# Splinux is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Send your feedback or comments to: nebil.reyhani@gmail.com
# 



if [ -f /etc/SuSE-release ]; then
  DISTRO=`cat /etc/SuSE-release | grep -i 'suse'`
  VERSION=`cat /etc/SuSE-release | grep 'VERSION' | cut -c 11-`
elif [ -f /etc/lsb-release ]; then
  DISTRO=`cat /etc/lsb-release | grep 'DISTRIB_ID' | cut -c 12-`
  VERSION=`cat /etc/lsb-release | grep 'DISTRIB_RELEASE' | cut -c 17-`
else
  DISTRO="Unkonwn"
  VERSION="Unknown"
fi

command=$1

export DISPLAY=$2

echo " "
echo "  +=================================================+"
echo "  |            Welcome to parallel Linux            |"
echo "  +=================================================+"
echo " "
echo "  DISTRO  : $DISTRO"
echo "  VERSION : $VERSION"
echo "  HOSTNAME: $HOSTNAME"
echo "  USER    : $LOGNAME"
echo "  COMMAND : $command"
echo " "
echo " "

gfmessage -d 6 -a center --text-alignment=left --markup-text="<span foreground=\"pink\" font_desc=\"serif 28\"><b><i> Welcome to parallel Linux </i></b></span>
<span foreground=\"yellow\" font_desc=\"12\">
<tt>DISTRO  : </tt><span font_desc=\"14\">$DISTRO</span>
<tt>VERSION : </tt><span font_desc=\"14\">$VERSION</span>
<tt>HOSTNAME: </tt><span font_desc=\"14\">$HOSTNAME</span>
<tt>USER    : </tt><span font_desc=\"14\">$LOGNAME</span>
<tt>COMMAND : </tt><span font_desc=\"14\">$command</span>
</span>"

"$command"

exit

