syssetup/os_probe.bash

39 lines
708 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?
# We are going to do a double check here using lsb_release
if [ -x "$(command -v lsb_release)" ]; then
# osp=$(lsb_release -i | awk '{print $3}')
fi