aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2018-06-09 15:43:35 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2018-06-09 15:43:35 +0300
commite75f1488779778f8e1f375243cd6ad9e6183fb5f (patch)
tree764f4066db95febcd90fe004de63ed5cbe29ce4a
parent.bashrc: remove ssh-copy-id alias (diff)
downloadlinux-home-e75f1488779778f8e1f375243cd6ad9e6183fb5f.tar.gz
linux-home-e75f1488779778f8e1f375243cd6ad9e6183fb5f.zip
os.sh: support Arch Linux ARM
Diffstat (limited to '')
-rw-r--r--%HOME%/.bash_utils/os.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/%HOME%/.bash_utils/os.sh b/%HOME%/.bash_utils/os.sh
index 9058b38..b063cbc 100644
--- a/%HOME%/.bash_utils/os.sh
+++ b/%HOME%/.bash_utils/os.sh
@@ -11,6 +11,7 @@ _CYGWIN='Cygwin'
_UBUNTU='Ubuntu'
_MINT='Linux Mint'
_ARCH='Arch Linux'
+_ARCH_ARM='Arch Linux ARM'
_FEDORA='Fedora'
os_detect() {
@@ -21,10 +22,11 @@ os_detect() {
[ -r /etc/os-release ] \
&& _os="$( . /etc/os-release && echo "$NAME" )" \
- && test "$_os" == "$_UBUNTU" \
- -o "$_os" == "$_MINT" \
- -o "$_os" == "$_ARCH" \
- -o "$_os" == "$_FEDORA" \
+ && test "$_os" == "$_UBUNTU" \
+ -o "$_os" == "$_MINT" \
+ -o "$_os" == "$_ARCH" \
+ -o "$_os" == "$_ARCH_ARM" \
+ -o "$_os" == "$_FEDORA" \
&& return 0
_os=''
@@ -38,7 +40,7 @@ os_detected() { test -n "$_os" ; }
os_is_cygwin() { test "$_os" == "$_CYGWIN" ; }
os_is_ubuntu() { test "$_os" == "$_UBUNTU" ; }
os_is_mint() { test "$_os" == "$_MINT" ; }
-os_is_arch() { test "$_os" == "$_ARCH" ; }
+os_is_arch() { test "$_os" == "$_ARCH" -o "$_os" == "$_ARCH_ARM" ; }
os_is_fedora() { test "$_os" == "$_FEDORA" ; }
# Cygwin
@@ -125,7 +127,7 @@ pkg_list() (
elif os_is_fedora; then
pkg_list_fedora
else
- echo "${FUNCTION[0]}: unsupported OS" >&2
+ echo "${FUNCNAME[0]}: unsupported OS" >&2
return 1
fi
)