#! /bin/tcsh -f # {{{ Versioning and license info # # $Id: setup,v 1.13 2006/08/21 15:55:14 proclus Exp $ # Many thanks to Robert L. Campbell # Copyright (C) 2006 Michael L. Love # # This program 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 2 # of the License, or (at your option) 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # or find it at: http://www.gnu.org/copyleft/gpl.html # # }}} # {{{ Variable definitions setenv BOLD "" setenv UNBOLD "" setenv PREMARK "[01;" setenv POSTMARK "m" setenv UNMARK "" # cleanup ansi here ;-} # setenv UNMARK "" setenv UNMARK "" setenv UNMARK "" setenv UNMARK "" setenv LTGREY ${PREMARK}0${POSTMARK} setenv UNLTGREY ${UNMARK} setenv UNDERLINE ${PREMARK}4${POSTMARK} setenv UNUNDERLINE ${UNMARK} setenv BLINK ${PREMARK}5${POSTMARK} setenv UNBLINK ${UNMARK} setenv BLOCK ${PREMARK}7${POSTMARK} setenv UNBLOCK ${UNMARK} setenv GREY ${PREMARK}30${POSTMARK} setenv UNGREY ${UNMARK} setenv YELLOW ${PREMARK}33${POSTMARK} setenv UNYELLOW ${UNMARK} setenv GREEN ${PREMARK}32${POSTMARK} setenv UNGREEN ${UNMARK} setenv BLUE ${PREMARK}34${POSTMARK} setenv UNBLUE ${UNMARK} setenv CYAN ${PREMARK}36${POSTMARK} setenv UNCYAN ${UNMARK} setenv RED ${PREMARK}31${POSTMARK} setenv UNRED ${UNMARK} setenv MAGENTA ${PREMARK}35${POSTMARK} setenv UNMAGENTA ${UNMARK} setenv WHITE ${PREMARK}37${POSTMARK} setenv UNWHITE ${UNMARK} setenv BLOCKYELLOW ${PREMARK}43${POSTMARK} setenv UNBLOCKYELLOW ${UNMARK} setenv BLOCKGREEN ${PREMARK}42${POSTMARK} setenv UNBLOCKGREEN ${UNMARK} setenv BLOCKBLUE ${PREMARK}44${POSTMARK} setenv UNBLOCKBLUE ${UNMARK} setenv BLOCKCYAN ${PREMARK}46${POSTMARK} setenv UNBLOCKCYAN ${UNMARK} setenv BLOCKRED ${PREMARK}41${POSTMARK} setenv UNBLOCKRED ${UNMARK} setenv BLOCKMAGENTA ${PREMARK}45${POSTMARK} setenv UNBLOCKMAGENTA ${UNMARK} setenv BLOCKWHITE ${PREMARK}47${POSTMARK} setenv UNBLOCKWHITE ${UNMARK} # }}} # {{{ Set some basic/general values # determine operating system (architecture) setenv OS `uname -s` setenv OS_VERSION `uname -r` setenv MACHINE `uname -m` if ( -f /etc/debian_version ) then setenv DISTRO Debian else if ( -f /etc/fedora-release ) then setenv DISTRO FedoraCore else setenv DISTRO endif # make some big programs run better! if ( ${OS} != 'Darwin' && ${OS_VERSION} != '7.0.0' ) then unlimit stacksize limit coredumpsize 0 endif # }}} setenv pathDepth `echo $0 | sed s/'^\.'// | sed s/'^\/'// | sed s/'\/'/'\t'/g | wc -w` setenv progName `echo $0 | sed s/'^\.'// | sed s/'^\/'// | sed s/'\/'/'\t'/g | cut -f${pathDepth}` echo echo Welcome to ${GREEN}${progName}${UNGREEN} echo echo "Your OS is: ${CYAN}${DISTRO}${UNCYAN} " echo " ${BLUE}${OS}${UNBLUE} " echo " ${MAGENTA}${OS_VERSION}${UNMAGENTA} " echo " ${RED}${MACHINE}${UNRED} " echo echo $LTGREY LTGREY $UNLTGREY $UNDERLINE UNDERLINE $UNUNDERLINE echo $GREY GREY $UNGREY$YELLOW YELLOW $UNYELLOW $GREEN GREEN $UNGREEN echo $BLINK BLINK $UNBLINK$BLOCKYELLOW BLOCKYELLOW $UNBLOCKYELLOW$BLOCKGREEN BLOCKGREEN $UNBLOCKGREEN echo $BLUE BLUE $UNBLUE $CYAN CYAN $UNCYAN $RED RED $UNRED $MAGENTA MAGENTA $UNMAGENTA $WHITE WHITE $UNWHITE echo $BLOCKBLUE BLOCKBLUE $UNBLOCKBLUE$BLOCKCYAN BLOCKCYAN $UNBLOCKCYAN$BLOCKRED BLOCKRED $UNBLOCKRED$BLOCKMAGENTA BLOCKMAGENTA $UNBLOCKMAGENTA$BLOCK BLOCK $UNBLOCK$BLOCKWHITE BLOCKWHITE $UNBLOCKWHITE setenv divider ${BLUE}'|'${UNBLUE} setenv theCommands `grep -a -H ':$' ${0} | cut -f2 -d:` if ( $#argv != 0 ) then goto $1 else setenv theGoto `echo ${theCommands} | grep $progName` if ( ${theGoto} != '' ) then goto ${theGoto} endif endif code: echo Put code here. exit help: echo echo 'Maybe should write something for this spot?' commands: echo echo The following ${GREEN}${progName}${UNGREEN} commands are available: echo grep -a -H ':$' $0 | sed s/:/' '/g echo exit makelinks: setenv theGoto `echo ${theCommands} | grep $progName` if ( ${theGoto} != '' ) then echo run this with the who_awake command exit endif foreach i ( `grep -a -H ':$' ${0} | cut -f2 -d: | grep -v ssh` ) echo 'ln -sf '$0' '${i} | csh end ln -sf $0 who_awake exit neverGetsHere: