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 set +e
lsb_release=$(which lsb_release 2>/dev/null) case "$($__explorer/os)" in
if [ -x "$lsb_release" ]; then openwrt)
$lsb_release --short --codename (. /etc/openwrt_release && echo "$DISTRIB_CODENAME")
fi ;;
*)
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 set +e
lsb_release=$(which lsb_release 2>/dev/null) case "$($__explorer/os)" in
if [ -x "$lsb_release" ]; then openwrt)
$lsb_release --short --description (. /etc/openwrt_release && echo "$DISTRIB_DESCRIPTION")
fi ;;
*)
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 set +e
lsb_release=$(which lsb_release 2>/dev/null) case "$($__explorer/os)" in
if [ -x "$lsb_release" ]; then openwrt)
$lsb_release --short --id (. /etc/openwrt_release && echo "$DISTRIB_ID")
fi ;;
*)
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 set +e
lsb_release=$(which lsb_release 2>/dev/null) case "$($__explorer/os)" in
if [ -x "$lsb_release" ]; then openwrt)
$lsb_release --short --release (. /etc/openwrt_release && echo "$DISTRIB_RELEASE")
fi ;;
*)
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 exit 0
fi fi
if [ -f /etc/openwrt_version ]; then
echo openwrt
exit 0
fi
if [ -f /etc/owl-release ]; then if [ -f /etc/owl-release ]; then
echo owl echo owl
exit 0 exit 0

View file

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