X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=blobdiff_plain;f=lib.sh;h=ea61359e2e806be5b26aaff201930743d7214b5a;hp=5576bce23beab7f48e6cbd989ea6c243cb04a2b5;hb=144b79caff995d7c5773e3efb66813bf131de0e2;hpb=7821db6c9f585f95459f04bd216a417194a29dc4 diff --git a/lib.sh b/lib.sh index 5576bce..ea61359 100644 --- a/lib.sh +++ b/lib.sh @@ -17,6 +17,19 @@ installed() { which $1 | grep -E '^/' > /dev/null } +# Prints the current OS. Supported are Debian (debian) and Mac OS X (darwin) +# at the moment. If an unsupported OS is used an error is printed. +os() { + if [ -f /etc/debian_version ]; then + echo debian + elif [ x`uname` = xDarwin ]; then + echo darwin + else + echo unsupported OS! >&2 + return 1 + fi +} + # Creates a symbolic link for file $1 in dirname of $2 with name of basenmae # $2. #