source: trunk/third-party/miniupnp/updateminiupnpcstrings.sh @ 11381

Last change on this file since 11381 was 11381, checked in by charles, 10 years ago

(trunk third-party) #3707 "remove dependency to which" -- committed. fix by geirha.

  • Property svn:executable set to *
File size: 824 bytes
Line 
1#! /bin/sh
2# $Id: updateminiupnpcstrings.sh,v 1.4 2009/07/29 08:34:01 nanard Exp $
3
4TEMPLATE_FILE=$1
5OUTPUT_FILE=$2
6
7# detecting the OS name and version
8OS_NAME=`uname -s`
9OS_VERSION=`uname -r`
10if [ -f /etc/debian_version ]; then
11        OS_NAME=Debian
12        OS_VERSION=`cat /etc/debian_version`
13fi
14# use lsb_release (Linux Standard Base) when available
15if os_name=`lsb_release -i -s 2>/dev/null`; then
16    OS_NAME=$os_name
17    OS_VERSION=`lsb_release -r -s`
18fi
19
20echo "Detected OS [$OS_NAME] version [$OS_VERSION]"
21
22EXPR="s|OS_STRING \".*\"|OS_STRING \"${OS_NAME}/${OS_VERSION}\"|"
23#echo $EXPR
24#echo "Backing up $OUTPUT_FILE to $OUTPUT_FILE.bak."
25#cp $OUTPUT_FILE $OUTPUT_FILE.bak
26test -f ${TEMPLATE_FILE}
27echo "setting OS_STRING macro value to ${OS_NAME}/${OS_VERSION} in $OUTPUT_FILE."
28sed -e "$EXPR" < $TEMPLATE_FILE > $OUTPUT_FILE
29
Note: See TracBrowser for help on using the repository browser.