summaryrefslogtreecommitdiff
path: root/build_tools
diff options
context:
space:
mode:
authorkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-05-22 23:11:36 +0000
committerkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-05-22 23:11:36 +0000
commit4a779c13cadc1af20cf4d5ab8de59e7b962c8738 (patch)
treeb512342c39423b4071f3e669295d7f9ed8fec6ff /build_tools
parent90e7b82338d7f27ab65714ec0404fb785effc897 (diff)
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/branches/1.2@1079 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'build_tools')
-rwxr-xr-xbuild_tools/genmodconf24
1 files changed, 19 insertions, 5 deletions
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