Fix OS detection for Debian kFreeBSD

This commit is contained in:
yangfl 2018-05-08 21:59:15 +08:00
parent bd836936f7
commit b3849ef311
4 changed files with 23 additions and 10 deletions

View File

@ -3,14 +3,21 @@
# (c) 2017 Thomas Bernard
OS=`uname -s`
IF=lo
if [ "$OS" = "Darwin" ] || [ "$OS" = "OpenBSD" ] || [ "$OS" = "SunOS" ] || [ "$OS" = "FreeBSD" ] ; then
IF=lo0
fi
# if set, 1st argument is network interface
if [ -n "$1" ] ; then
IF=$1
else
case $OS in
*BSD | Darwin | SunOS)
IF=lo0
;;
*)
IF=lo
;;
esac
fi
SOCKET=`mktemp -t minissdpdsocketXXXXXX`
PID="${SOCKET}.pid"
./minissdpd -s $SOCKET -p $PID -i $IF || exit 1

View File

@ -3,13 +3,19 @@
# (c) 2016 Thomas Bernard
OS=`uname -s`
IF=lo
if [ "$OS" = "Darwin" ] || [ "$OS" = "SunOS" ] ; then
IF=lo0
fi
# if set, 1st argument is network interface
if [ -n "$1" ] ; then
IF=$1
else
case $OS in
*BSD | Darwin | SunOS)
IF=lo0
;;
*)
IF=lo
;;
esac
fi
# trap sigint in the script so CTRL-C interrupts the running program,

View File

@ -164,7 +164,7 @@ case $OS_NAME in
OS_URL=http://www.openbsd.org/
V6SOCKETS_ARE_V6ONLY=`sysctl -n net.inet6.ip6.v6only`
;;
FreeBSD)
FreeBSD | GNU/kFreeBSD)
VER=`grep '#define __FreeBSD_version' /usr/include/sys/param.h | awk '{print $3}'`
if [ $VER -ge 700049 ]; then
echo "#define PFRULE_INOUT_COUNTS" >> ${CONFIGFILE}

View File

@ -3,7 +3,7 @@
OS=`uname -s`
case $OS in
FreeBSD | OpenBSD | Darwin | SunOS)
*BSD | Darwin | SunOS)
NS="`which netstat`" || exit 1
IFCONFIG="`which ifconfig`" || exit 1
EXTIF="`$NS -r -f inet | grep 'default' | awk '{ print $NF }' `" || exit 1