#!/usr/bin/env bash [ -a /etc/*-release ] && grep -q "Ubuntu" /etc/*-release && os="ubuntu"; [ -a /etc/*-release ] && grep -q "Red Hat" /etc/*-release && os="redhat"; [ -a /etc/issue ] && grep -q "Debian" /etc/issue && os="debian"; [ ! -z $(which uname) ] && uname -a | grep -q "Darwin" && os="darwin"; case "${os}" in darwin ) echo "Darwin!";; ubuntu ) echo "Ubuntu!";; debian ) echo "Debian!";; redhat ) echo "Red Hat!";; * ) echo "You're dumb and your computer hates you!";; esac
http://pastebin.com/f53e15b06
No comments:
Post a Comment