syssetup/os_probe.bash

29 lines
550 B
Bash
Executable file

#!/bin/bash
# OS probing component
# Not an easy task to identify the distro, this app supports Debian based and Arch based
# Our best bet is to look for which package manager is installed
# check if apt-get is installed
if [ -x "$(command -v apt-get)" ]; then
# set environment variable for os
osp="Debian"
fi
# check if pacman is installed
if [ -x "$(command -v pacman)" ]; then
osp="Arch"
fi
# check if opkg is installed
if [ -x "$(command -v opkg)" ]; then
osp="Openwrt"
fi
# I know its so high tech and amazing right?