Properly detect OpenWRT in global explorers

Signed-off-by: Giel van Schijndel <giel+cdist@mortis.eu>
This commit is contained in:
Giel van Schijndel 2012-02-19 19:48:05 +01:00
parent 5e20ba5a13
commit 9538ef6462
6 changed files with 52 additions and 16 deletions

View file

@ -20,7 +20,14 @@
#
set +e
case "$($__explorer/os)" in
openwrt)
(. /etc/openwrt_release && echo "$DISTRIB_CODENAME")
;;
*)
lsb_release=$(which lsb_release 2>/dev/null)
if [ -x "$lsb_release" ]; then
$lsb_release --short --codename
fi
;;
esac

View file

@ -20,7 +20,14 @@
#
set +e
case "$($__explorer/os)" in
openwrt)
(. /etc/openwrt_release && echo "$DISTRIB_DESCRIPTION")
;;
*)
lsb_release=$(which lsb_release 2>/dev/null)
if [ -x "$lsb_release" ]; then
$lsb_release --short --description
fi
;;
esac

View file

@ -20,7 +20,14 @@
#
set +e
case "$($__explorer/os)" in
openwrt)
(. /etc/openwrt_release && echo "$DISTRIB_ID")
;;
*)
lsb_release=$(which lsb_release 2>/dev/null)
if [ -x "$lsb_release" ]; then
$lsb_release --short --id
fi
;;
esac

View file

@ -20,7 +20,14 @@
#
set +e
case "$($__explorer/os)" in
openwrt)
(. /etc/openwrt_release && echo "$DISTRIB_RELEASE")
;;
*)
lsb_release=$(which lsb_release 2>/dev/null)
if [ -x "$lsb_release" ]; then
$lsb_release --short --release
fi
;;
esac

View file

@ -56,6 +56,11 @@ if [ -f /etc/gentoo-release ]; then
exit 0
fi
if [ -f /etc/openwrt_version ]; then
echo openwrt
exit 0
fi
if [ -f /etc/owl-release ]; then
echo owl
exit 0

View file

@ -45,6 +45,9 @@ case "$($__explorer/os)" in
*bsd|solaris)
uname -r
;;
openwrt)
cat /etc/openwrt_version
;;
owl)
cat /etc/owl-release
;;