From 9ed7100299999ec8bfb0c62467f3362627a9f9c5 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Mon, 22 May 2006 23:12:07 +0000 Subject: Merged revisions 1079 via svnmerge from https://origsvn.digium.com/svn/zaptel/branches/1.2 ........ r1079 | kpfleming | 2006-05-22 18:11:36 -0500 (Mon, 22 May 2006) | 4 lines make a backup even when modifying non-combined rules files generate a warning about editing non-combined rules files ensure that the warning is the last output from the 'make install' process ........ git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1080 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- build_tools/genmodconf | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'build_tools') diff --git a/build_tools/genmodconf b/build_tools/genmodconf index cafc869..32435ee 100755 --- a/build_tools/genmodconf +++ b/build_tools/genmodconf @@ -36,7 +36,7 @@ if [ "${1}" == "linux24" ]; then target=${2}/etc/modutils/zaptel elif [ -f ${2}/etc/modules.conf ]; then target=${2}/etc/modules.conf - backup=1 + combined=1 else echo No suitable location for module rules can be found... exiting. exit 1 @@ -52,10 +52,10 @@ elif [ "${1}" == "linux26" ]; then target=${2}/etc/modules.d/zaptel elif [ -f ${2}/etc/modprobe.conf ]; then target=${2}/etc/modprobe.conf - backup=1 + combined=1 elif [ -f ${2}/etc/conf.modules ]; then target=${2}/etc/conf.modules - backup=1 + combined=1 else echo No suitable location for module rules can be found... exiting. exit 1 @@ -65,13 +65,15 @@ else exit 1 fi -if [ -n "${backup}" ]; then +if [ -n "${combined}" ]; then if [ -f ${target} ]; then mv ${target} ${target}.bak cat ${target}.bak | grep -v "alias char-major-250" | grep -v "alias char-major-196" > ${target} fi else - rm -f ${target} + if [ -f ${target} ]; then + mv ${target} ${target}.bak + fi echo "# automatically generated file; do not edit" > ${target} fi @@ -98,3 +100,15 @@ if ! grep -q "alias wct2xxp" ${target}; then echo "alias wct2xxp wct4xxp" >> ${target}; fi; +if [ -z "${combined}" ]; then + echo "***" + echo "*** WARNING:" + echo "*** If you had custom settings in ${target}," + echo "*** they have been moved to ${target}.bak." + echo "***" + echo "*** In the future, do not edit ${target}, but" + echo "*** instead put your changes in another file" + echo "*** in the same directory so that they will not" + echo "*** be overwritten by future Zaptel updates." + echo "***" +fi -- cgit v1.2.3