summaryrefslogblamecommitdiffstats
path: root/inc/functions.common.sh
blob: 75586c26d6997928b55778bdb914c4ff9061efc6 (plain) (tree)






































































                                                                      
SYSLINUX=${ROOT_DIR}/contrib/syslinux/latest
PATH="${ROOT_DIR}/bin/:$PATH"

QUIET="0"

banner () {

	echo -e "\t        __              __   __    "
	echo -e "\t.-----.|  |--.--------.|  |_|  |--."
	echo -e "\t|  _  ||  _  |        ||   _|    < "
	echo -e "\t|   __||_____|__|__|__||____|__|__|"
	echo -e "\t|__| "
	echo -e "\t                     ** OpenSLX Project // 2011 **"
	echo -e "\t                        http://lab.openslx.org/"
	echo -e ""

}

set_quiet () {
	if [ "x$DEBUG" != "x1" -a "x$QUIET" != "x1" ]; then
	  exec 6>&1 > $LOG_DIR/stdout.log
	  exec 2>  $LOG_DIR/stderr.log
	  QUIET="1"
	fi
}

unset_quiet () {
	if [ "x$QUIET" = "x1" ]; then
  	  exec 1>&6 6>&-
	  exec 2>&-
	  QUIET="0"
	fi
}


pinfo  () {
	unset_quiet
	echo -e    "[info]  $1"
	set_quiet
}
perror () { 
	unset_quiet
	echo -e    "[error] $1"
	set_quiet
}
pecho  () {
	unset_quiet
	echo -e    "[user]  $1"
	set_quiet
}
pechon () { 
	unset_quiet
	echo -e -n "[user]  $1"
	set_quiet
}

getopt_start () {
	
	GETOPT_TEMP=`getopt -o $SHORT_OPTS --long $LONG_OPTS \
     -n "$SELF" -- "$@"`
	
	if [ $? != 0 ] ; then 
	  perror "Unknown option(s).\n"
	  print_usage
	  exit 1
	fi
}

run_global_checks () {
	:	
}