Compare commits
2 Commits
99a4463433
...
7d3e47515d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d3e47515d | ||
|
|
d3b7bc2552 |
@ -23,7 +23,7 @@ set_tz() {
|
||||
local tz_current="$2"
|
||||
local tz_desired="$3"
|
||||
printf "$COL_LIGHT_BLUE" "* Desired Timezone is $tz_desired"
|
||||
if [ $tz_current != $tz_desired ]
|
||||
if [ "$tz_current" != "$tz_desired" ]
|
||||
then
|
||||
printf "$COL_LIGHT_BLUE" "* Setting Timezone to $desired_timezone"
|
||||
if [ "$tz_type" == "/etc/timezone" ]; then
|
||||
|
||||
@ -37,7 +37,37 @@ should_apt_last_update() {
|
||||
}
|
||||
|
||||
get_distro() {
|
||||
echo $(awk -F= '/^NAME/{print $2}' /etc/os-release)
|
||||
# echo $(awk -F= '/^NAME/{print $2}' /etc/os-release)
|
||||
if [ -f /etc/os-release ]; then
|
||||
# freedesktop.org and systemd
|
||||
. /etc/os-release
|
||||
OS=$NAME
|
||||
VER=$VERSION_ID
|
||||
elif type lsb_release >/dev/null 2>&1; then
|
||||
# linuxbase.org
|
||||
OS=$(lsb_release -si)
|
||||
VER=$(lsb_release -sr)
|
||||
elif [ -f /etc/lsb-release ]; then
|
||||
# For some versions of Debian/Ubuntu without lsb_release command
|
||||
. /etc/lsb-release
|
||||
OS=$DISTRIB_ID
|
||||
VER=$DISTRIB_RELEASE
|
||||
elif [ -f /etc/debian_version ]; then
|
||||
# Older Debian/Ubuntu/etc.
|
||||
OS=Debian
|
||||
VER=$(cat /etc/debian_version)
|
||||
elif [ -f /etc/SuSe-release ]; then
|
||||
# Older SuSE/etc.
|
||||
...
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
# Older Red Hat, CentOS, etc.
|
||||
...
|
||||
else
|
||||
# Fall back to uname, e.g. "Linux <version>", also works for BSD, etc.
|
||||
OS=$(uname -s)
|
||||
VER=$(uname -r)
|
||||
fi
|
||||
echo $OS
|
||||
}
|
||||
|
||||
get_pkg_mgr() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user