summaryrefslogtreecommitdiff
path: root/lib/os.sh
blob: eff8e9ccc5fdfb28389cb1e7cb6707d471da5c4d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
function os::kernel() {
	uname -s | tr '[:upper:]' '[:lower:]'
}

function os::distro() {
    if [[ "$(os::kernel)" = "linux" ]] && [[ -f /etc/os-release ]]; then
        source /etc/os-release
        echo "$ID" | tr '[:upper:]' '[:lower:]' | sed 's/^arch$/archlinux/'
        return
    fi
    echo "unknown"
}