All pastes #1842323 Raw Edit

Untitled

public shellscript v1 · immutable
#1842323 ·published 2010-03-16 12:54 UTC
rendered paste body
## Packageprocessing_distissue="`cat /etc/issue`"# FIXME: this should probably be somewhere else as root doesn't read this file. somewhere inside the global bash definitions,## FIXME: make sure this is sourced by a shell	_PKGMNGR=	if [ $UID != "0" ];then 		_PKGMNGR="`which sudo` " 	fi	case "$_distissue" in		*Fedora*|*fedora*|*FEDORA* )						_PKGMNGR="$_PKGMNGR `which yum` "						;;		*suse*|*Suse*|*SuSE*|*SUSE* )						_PKGMNGR="$_PKGMNGR `which zypper`"						;;		*debian*|*Debian*|*ubuntu*|*Ubuntu* )						_PKGMNGR="$_PKGMNGR `which aptitude`"						;;		* )						_PKGMNGR=						;;	esac	# ====== DEBUG ============#	alias yue="echo $_PKGMNGR"	# =============================	## Define aliases for common commands if a package-manager exists	if [ "$_PKGMNGR" != "" ]; then		    alias yumi="$_PKGMNGR install"		    alias yup="$_PKGMNGR update"		    alias yurp="$_PKGMNGR remove"		    alias yus="$_PKGMNGR search"		    alias yusi="$_PKGMNGR info"	fi	unset _PKGMNGR _distissue