aboutsummaryrefslogtreecommitdiff
path: root/external/miniupnpc/updateminiupnpcstrings.sh
diff options
context:
space:
mode:
authorAntonio Juarez <antonio.maria.juarez@live.com>2014-04-09 13:14:35 +0100
committerAntonio Juarez <antonio.maria.juarez@live.com>2014-04-09 13:14:35 +0100
commit9682a15400495ae490543e7e5af242ff5c4c9fa0 (patch)
tree63ba7287d8f679742a244413291d4334fc26b6e6 /external/miniupnpc/updateminiupnpcstrings.sh
parentImprovements in JSON RPC (diff)
downloadmonero-9682a15400495ae490543e7e5af242ff5c4c9fa0.tar.xz
Port mapping with UPnP
Diffstat (limited to 'external/miniupnpc/updateminiupnpcstrings.sh')
-rwxr-xr-xexternal/miniupnpc/updateminiupnpcstrings.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/external/miniupnpc/updateminiupnpcstrings.sh b/external/miniupnpc/updateminiupnpcstrings.sh
new file mode 100755
index 000000000..dde4354a8
--- /dev/null
+++ b/external/miniupnpc/updateminiupnpcstrings.sh
@@ -0,0 +1,53 @@
+#! /bin/sh
+# $Id: updateminiupnpcstrings.sh,v 1.7 2011/01/04 11:41:53 nanard Exp $
+# project miniupnp : http://miniupnp.free.fr/
+# (c) 2009 Thomas Bernard
+
+FILE=miniupnpcstrings.h
+TMPFILE=miniupnpcstrings.h.tmp
+TEMPLATE_FILE=${FILE}.in
+
+# detecting the OS name and version
+OS_NAME=`uname -s`
+OS_VERSION=`uname -r`
+if [ -f /etc/debian_version ]; then
+ OS_NAME=Debian
+ OS_VERSION=`cat /etc/debian_version`
+fi
+# use lsb_release (Linux Standard Base) when available
+LSB_RELEASE=`which lsb_release`
+if [ 0 -eq $? -a -x "${LSB_RELEASE}" ]; then
+ OS_NAME=`${LSB_RELEASE} -i -s`
+ OS_VERSION=`${LSB_RELEASE} -r -s`
+ case $OS_NAME in
+ Debian)
+ #OS_VERSION=`${LSB_RELEASE} -c -s`
+ ;;
+ Ubuntu)
+ #OS_VERSION=`${LSB_RELEASE} -c -s`
+ ;;
+ esac
+fi
+
+# on AmigaOS 3, uname -r returns "unknown", so we use uname -v
+if [ "$OS_NAME" = "AmigaOS" ]; then
+ if [ "$OS_VERSION" = "unknown" ]; then
+ OS_VERSION=`uname -v`
+ fi
+fi
+
+echo "Detected OS [$OS_NAME] version [$OS_VERSION]"
+MINIUPNPC_VERSION=`cat VERSION`
+echo "MiniUPnPc version [${MINIUPNPC_VERSION}]"
+
+EXPR="s|OS_STRING \".*\"|OS_STRING \"${OS_NAME}/${OS_VERSION}\"|"
+#echo $EXPR
+test -f ${FILE}.in
+echo "setting OS_STRING macro value to ${OS_NAME}/${OS_VERSION} in $FILE."
+sed -e "$EXPR" < $TEMPLATE_FILE > $TMPFILE
+
+EXPR="s|MINIUPNPC_VERSION_STRING \".*\"|MINIUPNPC_VERSION_STRING \"${MINIUPNPC_VERSION}\"|"
+echo "setting MINIUPNPC_VERSION_STRING macro value to ${MINIUPNPC_VERSION} in $FILE."
+sed -e "$EXPR" < $TMPFILE > $FILE
+rm $TMPFILE
+