diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2006-01-06 00:23:29 +0000 |
---|---|---|
committer | Matthias Schwarzott <zzam@gentoo.org> | 2006-01-06 00:23:29 +0000 |
commit | 09a77539c5446d9a18fac6e26eec7725c50a07a0 (patch) | |
tree | e52923a82ad8de0be078d63c0e63f8455edd700e | |
parent | moved commands-file handling into seperate file (diff) | |
download | gentoo-vdr-scripts-09a77539c5446d9a18fac6e26eec7725c50a07a0.tar.gz gentoo-vdr-scripts-09a77539c5446d9a18fac6e26eec7725c50a07a0.tar.bz2 gentoo-vdr-scripts-09a77539c5446d9a18fac6e26eec7725c50a07a0.zip |
some small fixes for changes before
svn path=/gentoo-vdr-scripts/trunk/; revision=123
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | usr/lib/vdr/inc/commands-functions.sh | 32 | ||||
-rw-r--r-- | usr/lib/vdr/inc/rc-functions.sh | 2 |
3 files changed, 23 insertions, 15 deletions
@@ -1,6 +1,10 @@ # ChangeLog for gentoo-vdr-scripts 06 Jan 2006; Matthias Schwarzott <zzam@gentoo.org> + usr/lib/vdr/inc/commands-functions.sh, usr/lib/vdr/inc/rc-functions.sh: + some small fixes for changes before + + 06 Jan 2006; Matthias Schwarzott <zzam@gentoo.org> usr/lib/vdr/rcscript/pre-start-40-config-files.sh, +usr/lib/vdr/inc/commands-functions.sh: moved commands-file handling into seperate file diff --git a/usr/lib/vdr/inc/commands-functions.sh b/usr/lib/vdr/inc/commands-functions.sh index 918b41b..fc1dcfe 100644 --- a/usr/lib/vdr/inc/commands-functions.sh +++ b/usr/lib/vdr/inc/commands-functions.sh @@ -5,21 +5,9 @@ merge_commands_conf() { local order="${3}" local bname=${destfile##*/} - local mergedfile="/var/vdr/merged-config-files/${bname}.conf" - - if [[ -L "${destfile}" ]]; then - # remove link - rm "${destfile}" - else - # no link - if [[ -f "${destfile}" ]]; then - mv "${destfile}" "${destfile}.backup" - einfo " Saved original ${destfile} as ${destfile}.backup" - fi - fi - - ln -s "${mergedfile}" "${destfilefile}" + local mergedfile="/var/vdr/merged-config-files/${bname}" + # merging files if [[ -f "${mergedfile}" ]]; then if ! rm "${mergedfile}"; then ewarn " Could not change ${mergedfile}" @@ -27,6 +15,7 @@ merge_commands_conf() { fi fi cat > "${mergedfile}" <<-EOT + # Autogenerated ${destfile} # Warning: Do not change this file. # This file is generated automatically by /etc/init.d/vdr. # Change the source files under ${sdir}. @@ -40,6 +29,21 @@ EOT cat "${f}" >> "${mergedfile}" echo >> "${mergedfile}" done + + # link it to real location + if [[ -L "${destfile}" ]]; then + # remove link + rm "${destfile}" + else + # no link + if [[ -f "${destfile}" ]]; then + mv "${destfile}" "${destfile}.backup" + einfo " Saved original ${destfile} as ${destfile}.backup" + fi + fi + + ln -s "${mergedfile}" "${destfile}" + } # merge_commands_conf /etc/vdr/commands /etc/vdr/commands.conf "${ORDER_COMMANDS}" diff --git a/usr/lib/vdr/inc/rc-functions.sh b/usr/lib/vdr/inc/rc-functions.sh index 9b5e246..4498130 100644 --- a/usr/lib/vdr/inc/rc-functions.sh +++ b/usr/lib/vdr/inc/rc-functions.sh @@ -1,5 +1,5 @@ -test -z "${vdr_rcdir}" && vdr_rcdir=/usr/lib/vdr/rcscripts +: ${vdr_rcdir:=/usr/lib/vdr/rcscript} : ${SCRIPT_DEBUG_LEVEL:=0} SCRIPT_API=2 |