diff options
author | Joerg Bornkessel <hd_brummy@gentoo.org> | 2012-02-17 18:54:13 +0100 |
---|---|---|
committer | Joerg Bornkessel <hd_brummy@gentoo.org> | 2012-02-17 18:54:13 +0100 |
commit | 7a1ba5eb47e8ee6e9faba6ae9ca50b08d822d324 (patch) | |
tree | 8973de6d30a99958c854bb9b841d114b08d149c0 | |
parent | svdrpsend.pl/svdrpsend detection, command will works now with all vdr versions (diff) | |
download | gentoo-vdr-scripts-7a1ba5eb47e8ee6e9faba6ae9ca50b08d822d324.tar.gz gentoo-vdr-scripts-7a1ba5eb47e8ee6e9faba6ae9ca50b08d822d324.tar.bz2 gentoo-vdr-scripts-7a1ba5eb47e8ee6e9faba6ae9ca50b08d822d324.zip |
Qouting, whitespace, minor fixes
34 files changed, 56 insertions, 74 deletions
@@ -2,6 +2,36 @@ # $Id$ 17 Feb 2012; Joerg Bornkessel <hd_brummy@gentoo.org> + usr/share/vdr/rcscript/post-start-05-plugins.sh, + usr/share/vdr/shutdown/pre-shutdown-05-time-calculations.sh, + usr/share/vdr/rcscript/pre-start-10-chuid.sh, + usr/share/vdr/shutdown/pre-shutdown-20-check-blocking-programs.sh, + usr/share/vdr/rcscript/pre-start-20-dvb-device.sh, + usr/share/vdr/rcscript/watchdog-restart-20-modules.sh, + usr/share/vdr/shutdown/pre-shutdown-40-time.sh, + usr/share/vdr/rcscript/pre-start-45-locales.sh, + usr/share/vdr/rcscript/pre-start-45-nptl-check.sh, + usr/share/vdr/shutdown/periodic-50-epgscan.sh, + usr/share/vdr/rcscript/pre-start-50-shutdown.sh, + usr/share/vdr/rcscript/post-start-50-svdrp.sh, + usr/share/vdr/rcscript/post-start-60-check-syslog-errors.sh, + usr/share/vdr/rcscript/pre-start-60-check-syslog-errors.sh, + usr/share/vdr/rcscript/pre-start-98-wait-conditions.sh, + usr/share/vdr/shutdown/pre-shutdown-99-periodic-thread.sh, + usr/sbin/acpi-wakeup.sh, usr/sbin/dvb-reload-modules, usr/sbin/rtc-wakeup.sh, + usr/sbin/vdr-get-header-checksum, usr/sbin/vdr-watchdogd, + usr/share/vdr/bin/vdrrecord-gate.sh, usr/share/vdr/bin/vdrshutdown-gate.sh, + usr/share/vdr/bin/vdrshutdown-periodic-thread.sh, + usr/share/vdr/bin/vdrshutdown-really.sh, + usr/share/vdr/bin/vdrshutdown-wakeup-helper.sh, + usr/share/vdr/dvdchanger/dvdchanger_readdvd.sh, + usr/share/vdr/dvdchanger/dvdchanger_writedvd.sh, + usr/share/vdr/inc/commands-functions.sh, usr/share/vdr/inc/functions.sh, + usr/share/vdr/inc/rc-functions.sh, usr/share/vdr/inc/svdrpcmd.sh, + usr/share/vdr/inc/time.sh: + Qouting, whitespace, minor fixes + + 17 Feb 2012; Joerg Bornkessel <hd_brummy@gentoo.org> usr/share/vdr/shutdown/periodic-50-epgscan.sh, usr/share/vdr/rcscript/post-start-50-svdrp.sh, +usr/share/vdr/inc/svdrpcmd.sh, usr/share/vdr/bin/vdrrecord-gate.sh, diff --git a/usr/sbin/acpi-wakeup.sh b/usr/sbin/acpi-wakeup.sh index 117c0ac..a840053 100755 --- a/usr/sbin/acpi-wakeup.sh +++ b/usr/sbin/acpi-wakeup.sh @@ -15,14 +15,12 @@ PROC_ALARM="/proc/acpi/alarm" -die() -{ +die() { echo "ERROR: $@" 1>&2 exit 1 } -checkUTC() -{ +checkUTC() { unset clock unset CLOCK local f @@ -37,8 +35,7 @@ checkUTC() [ "${clock}" = "UTC" ] } -writeAlarm() -{ +writeAlarm() { # write 2 times (some bioses need this) echo "$1" > "${PROC_ALARM}" echo "$1" > "${PROC_ALARM}" diff --git a/usr/sbin/dvb-reload-modules b/usr/sbin/dvb-reload-modules index 4e86fee..79dc719 100755 --- a/usr/sbin/dvb-reload-modules +++ b/usr/sbin/dvb-reload-modules @@ -118,4 +118,3 @@ case $1 in esac exit 0 - diff --git a/usr/sbin/rtc-wakeup.sh b/usr/sbin/rtc-wakeup.sh index d8b1de6..c6bdc16 100755 --- a/usr/sbin/rtc-wakeup.sh +++ b/usr/sbin/rtc-wakeup.sh @@ -15,8 +15,7 @@ RTC_ALARM="/sys/class/rtc/rtc0/wakealarm" -die() -{ +die() { echo "ERROR: $@" 1>&2 exit 1 } diff --git a/usr/sbin/vdr-get-header-checksum b/usr/sbin/vdr-get-header-checksum index b981eaf..fa38ce4 100755 --- a/usr/sbin/vdr-get-header-checksum +++ b/usr/sbin/vdr-get-header-checksum @@ -55,4 +55,3 @@ fi verbose "Checksum created." exit 0 - diff --git a/usr/sbin/vdr-watchdogd b/usr/sbin/vdr-watchdogd index af19823..6c9a071 100755 --- a/usr/sbin/vdr-watchdogd +++ b/usr/sbin/vdr-watchdogd @@ -13,6 +13,7 @@ exec < /dev/null exec >/dev/null 2>&1 . /etc/conf.d/vdr.watchdogd + DEBUG=1 [ "$1" = "--debug" ] && DEBUG=1 @@ -94,4 +95,3 @@ main() { } main - diff --git a/usr/share/vdr/bin/vdrrecord-gate.sh b/usr/share/vdr/bin/vdrrecord-gate.sh index 94c6742..2c1fdca 100644 --- a/usr/share/vdr/bin/vdrrecord-gate.sh +++ b/usr/share/vdr/bin/vdrrecord-gate.sh @@ -22,7 +22,7 @@ OLD_HOOKDIR=/usr/lib/vdr/record svdrp_command mesg() { - ${SVDRPCMD} MESG "\"$@\"" + "${SVDRPCMD}" MESG "\"$@\"" } VDR_RECORD_STATE="$1" diff --git a/usr/share/vdr/bin/vdrshutdown-gate.sh b/usr/share/vdr/bin/vdrshutdown-gate.sh index 1290611..8d7ccf1 100644 --- a/usr/share/vdr/bin/vdrshutdown-gate.sh +++ b/usr/share/vdr/bin/vdrshutdown-gate.sh @@ -27,4 +27,3 @@ sudo /usr/share/vdr/bin/vdrshutdown-really.sh "$@" [ $? = 1 ] && mesg "sudo failed: call emerge --config gentoo-vdr-scripts" exit 0 - diff --git a/usr/share/vdr/bin/vdrshutdown-periodic-thread.sh b/usr/share/vdr/bin/vdrshutdown-periodic-thread.sh index 0581336..10dedfa 100644 --- a/usr/share/vdr/bin/vdrshutdown-periodic-thread.sh +++ b/usr/share/vdr/bin/vdrshutdown-periodic-thread.sh @@ -19,7 +19,7 @@ THREAD_DIR=/usr/share/vdr/shutdown PERIODIC_THREAD_ENDTIME=${shutdown_data_dir}/periodic_thread_last_ended mesg() { - ${SVDRPCMD} mesg "${1}" + "${SVDRPCMD}" mesg "${1}" } sleep 15s @@ -36,7 +36,7 @@ mesg "periodic thread finished" sleep 3s -svdrpsend hitk back +"${SVDRPCMD}" hitk back if [ "${CAP_SHUTDOWN_SVDRP}" = "1" ]; then ${SVDRPCMD} DOWN diff --git a/usr/share/vdr/bin/vdrshutdown-really.sh b/usr/share/vdr/bin/vdrshutdown-really.sh index 4cbbe4d..b4f2217 100644 --- a/usr/share/vdr/bin/vdrshutdown-really.sh +++ b/usr/share/vdr/bin/vdrshutdown-really.sh @@ -248,4 +248,3 @@ else fi exit 0 - diff --git a/usr/share/vdr/bin/vdrshutdown-wakeup-helper.sh b/usr/share/vdr/bin/vdrshutdown-wakeup-helper.sh index 32835d6..dbb567f 100644 --- a/usr/share/vdr/bin/vdrshutdown-wakeup-helper.sh +++ b/usr/share/vdr/bin/vdrshutdown-wakeup-helper.sh @@ -18,7 +18,6 @@ fi . /usr/share/vdr/inc/functions.sh include shutdown-functions shutdown_script_dir=/usr/share/vdr/shutdown -## SVDRPCMD=/usr/bin/svdrpsend if [ "${DEBUG}" -ge 1 ]; then exec >/tmp/vdrshutdown-wakeup-helper.log 2>&1 @@ -100,4 +99,3 @@ _set_wakeup || return 98 _do_shutdown || return 97 exit 0 - diff --git a/usr/share/vdr/dvdchanger/dvdchanger_readdvd.sh b/usr/share/vdr/dvdchanger/dvdchanger_readdvd.sh index 0cf3d2a..adef776 100755 --- a/usr/share/vdr/dvdchanger/dvdchanger_readdvd.sh +++ b/usr/share/vdr/dvdchanger/dvdchanger_readdvd.sh @@ -28,8 +28,7 @@ if [[ -z ${EXECUTED_BY_VDR_BG} ]]; then fi rm -f "$1/$2" - -${SVDRPCMD} -d localhost "MESG DVD einlesen gestartet" -dd if="$3" of="$1/$2" -${SVDRPCMD} -d localhost "MESG DVD $2 fertig" +"${SVDRPCMD}" -d localhost "MESG DVD einlesen gestartet" +dd if="$3" of="$1/$2" +"${SVDRPCMD}" -d localhost "MESG DVD $2 fertig" diff --git a/usr/share/vdr/dvdchanger/dvdchanger_writedvd.sh b/usr/share/vdr/dvdchanger/dvdchanger_writedvd.sh index c919a12..a759c0a 100755 --- a/usr/share/vdr/dvdchanger/dvdchanger_writedvd.sh +++ b/usr/share/vdr/dvdchanger/dvdchanger_writedvd.sh @@ -35,6 +35,6 @@ fi unset SUDO_COMMAND -${SVDRPCMD} -d localhost "MESG DVD burn initiated" +"${SVDRPCMD}" -d localhost MESG "DVD burn initiated" "$DVD_RECORDCMD" $DVDPLUS_RECORD_OPTS -Z "$VDR_DVDWRITER"="${ISO_FILE}" -${SVDRPCMD} -d localhost "MESG DVD burn completed" +"${SVDRPCMD}" -d localhost MESG "DVD burn completed" diff --git a/usr/share/vdr/inc/commands-functions.sh b/usr/share/vdr/inc/commands-functions.sh index ae66ecf..6ffb479 100644 --- a/usr/share/vdr/inc/commands-functions.sh +++ b/usr/share/vdr/inc/commands-functions.sh @@ -57,10 +57,8 @@ EOT fi ln -s "${mergedfile}" "${destfile}" - } #Usage example # merge_commands_conf /etc/vdr/commands /etc/vdr/commands.conf "${ORDER_COMMANDS}" # merge_commands_conf /etc/vdr/reccmds /etc/vdr/reccmds.conf "${ORDER_RECCMDS}" - diff --git a/usr/share/vdr/inc/functions.sh b/usr/share/vdr/inc/functions.sh index c37fafc..f658125 100644 --- a/usr/share/vdr/inc/functions.sh +++ b/usr/share/vdr/inc/functions.sh @@ -2,8 +2,7 @@ # Handle inclusion of script-helper-files -include() -{ +include() { local name="${1}" local vname=loaded_$(echo ${name} | tr '-' '_') local check @@ -16,8 +15,7 @@ include() # Read file with definitions of capabilities of vdr-binary # e.g. svdrp-down-command / some patches -read_caps() -{ +read_caps() { local capfile=/usr/share/vdr/capabilities.sh [ -f "${capfile}" ] && . ${capfile} } @@ -25,8 +23,7 @@ read_caps() # read file containing just one integer value # $1 filename to read # returns read value on stdout if successfull, else returns 0 there -read_int_from_file() -{ +read_int_from_file() { local fname="$1" value="0" if [ -r "$fname" -a -s "$fname" ]; then value="$(cat "$fname")" @@ -36,8 +33,7 @@ read_int_from_file() if ! type yesno >/dev/null 2>&1; then -yesno() -{ +yesno() { [ -z "$1" ] && return 1 case "$1" in @@ -54,5 +50,3 @@ yesno() esac } fi - - diff --git a/usr/share/vdr/inc/rc-functions.sh b/usr/share/vdr/inc/rc-functions.sh index 05c489e..22abd3c 100644 --- a/usr/share/vdr/inc/rc-functions.sh +++ b/usr/share/vdr/inc/rc-functions.sh @@ -12,13 +12,11 @@ SCRIPT_API=2 read_caps -test_vdr_process() -{ +test_vdr_process() { pidof "${VDR_BIN}" >/dev/null } -getvdrversion() -{ +getvdrversion() { local include_dir=/usr/include/vdr VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' ${include_dir}/config.h) APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' ${include_dir}/config.h) @@ -31,31 +29,27 @@ getvdrversion() [ -z "${VDR_BIN}" ] && VDR_BIN=/usr/bin/vdr getvdrversion -getvdrversnum() -{ +getvdrversnum() { local include_dir=/usr/include/vdr VDRVERSNUM=$(awk '/define VDRVERSNUM/ {print $3}' ${include_dir}/config.h) } getvdrversnum -init_params() -{ +init_params() { # init variables for vdr/daemonctrl parameters vdr_opts="" daemonctrl_opts="" } -add_daemonctrl_param() -{ +add_daemonctrl_param() { while [ -n "$1" ]; do daemonctrl_opts="${daemonctrl_opts} '$1'" shift; done } -add_param() -{ +add_param() { while [ -n "$1" ]; do vdr_opts="${vdr_opts} '$1'" shift @@ -65,8 +59,7 @@ add_param() # # void load_addons_prefixed(char *prefix) # -load_addons_prefixed() -{ +load_addons_prefixed() { local addon_prefix=$1 call_func=${2:-addon_main} basename= ret=0 for addon in ${vdr_rc_dir}/${addon_prefix}-*.sh; do @@ -80,8 +73,7 @@ load_addons_prefixed() return $ret } -load_addon() -{ +load_addon() { local addon=${1} func=${2:-addon_main} local fname="${vdr_rc_dir}/${addon}.sh" [ -f ${fname} ] || fname="${addon}" diff --git a/usr/share/vdr/inc/svdrpcmd.sh b/usr/share/vdr/inc/svdrpcmd.sh index 7fbf4c5..a72d6fe 100644 --- a/usr/share/vdr/inc/svdrpcmd.sh +++ b/usr/share/vdr/inc/svdrpcmd.sh @@ -1,5 +1,3 @@ -#!/bin/sh - # Detect the svdrpsend.pl/svdrpsend script # changed in vdr-1.7.23 diff --git a/usr/share/vdr/inc/time.sh b/usr/share/vdr/inc/time.sh index 43ba439..b89e37f 100644 --- a/usr/share/vdr/inc/time.sh +++ b/usr/share/vdr/inc/time.sh @@ -77,4 +77,3 @@ check_interval() { return 1 fi } - diff --git a/usr/share/vdr/rcscript/post-start-05-plugins.sh b/usr/share/vdr/rcscript/post-start-05-plugins.sh index c97c196..3e20099 100644 --- a/usr/share/vdr/rcscript/post-start-05-plugins.sh +++ b/usr/share/vdr/rcscript/post-start-05-plugins.sh @@ -3,4 +3,3 @@ addon_main() { loop_all_plugins plugin_post_vdr_start } - diff --git a/usr/share/vdr/rcscript/post-start-50-svdrp.sh b/usr/share/vdr/rcscript/post-start-50-svdrp.sh index 6b738c5..af5c356 100644 --- a/usr/share/vdr/rcscript/post-start-50-svdrp.sh +++ b/usr/share/vdr/rcscript/post-start-50-svdrp.sh @@ -64,4 +64,3 @@ svdrp_ready() { fi return 1 } - diff --git a/usr/share/vdr/rcscript/post-start-60-check-syslog-errors.sh b/usr/share/vdr/rcscript/post-start-60-check-syslog-errors.sh index 536f520..8295e4b 100644 --- a/usr/share/vdr/rcscript/post-start-60-check-syslog-errors.sh +++ b/usr/share/vdr/rcscript/post-start-60-check-syslog-errors.sh @@ -40,4 +40,3 @@ addon_main() { return 0 } - diff --git a/usr/share/vdr/rcscript/pre-start-10-chuid.sh b/usr/share/vdr/rcscript/pre-start-10-chuid.sh index bf57bc3..42a8e93 100644 --- a/usr/share/vdr/rcscript/pre-start-10-chuid.sh +++ b/usr/share/vdr/rcscript/pre-start-10-chuid.sh @@ -10,4 +10,3 @@ addon_main() { fi return 0 } - diff --git a/usr/share/vdr/rcscript/pre-start-20-dvb-device.sh b/usr/share/vdr/rcscript/pre-start-20-dvb-device.sh index 7d358be..4fa4b68 100644 --- a/usr/share/vdr/rcscript/pre-start-20-dvb-device.sh +++ b/usr/share/vdr/rcscript/pre-start-20-dvb-device.sh @@ -14,4 +14,3 @@ addon_main() { fi return 0 } - diff --git a/usr/share/vdr/rcscript/pre-start-45-locales.sh b/usr/share/vdr/rcscript/pre-start-45-locales.sh index 46e2e6c..aa1e110 100644 --- a/usr/share/vdr/rcscript/pre-start-45-locales.sh +++ b/usr/share/vdr/rcscript/pre-start-45-locales.sh @@ -90,4 +90,3 @@ addon_main() { return 0 } - diff --git a/usr/share/vdr/rcscript/pre-start-45-nptl-check.sh b/usr/share/vdr/rcscript/pre-start-45-nptl-check.sh index 6a00cf8..e97b1d7 100644 --- a/usr/share/vdr/rcscript/pre-start-45-nptl-check.sh +++ b/usr/share/vdr/rcscript/pre-start-45-nptl-check.sh @@ -9,4 +9,3 @@ addon_main() { fi return 0 } - diff --git a/usr/share/vdr/rcscript/pre-start-50-shutdown.sh b/usr/share/vdr/rcscript/pre-start-50-shutdown.sh index 60d8156..789d71e 100644 --- a/usr/share/vdr/rcscript/pre-start-50-shutdown.sh +++ b/usr/share/vdr/rcscript/pre-start-50-shutdown.sh @@ -24,4 +24,3 @@ addon_main() { fi return 0 } - diff --git a/usr/share/vdr/rcscript/pre-start-60-check-syslog-errors.sh b/usr/share/vdr/rcscript/pre-start-60-check-syslog-errors.sh index 7e31a83..d7b11e3 100644 --- a/usr/share/vdr/rcscript/pre-start-60-check-syslog-errors.sh +++ b/usr/share/vdr/rcscript/pre-start-60-check-syslog-errors.sh @@ -22,4 +22,3 @@ addon_main() { fi return 0 } - diff --git a/usr/share/vdr/rcscript/pre-start-98-wait-conditions.sh b/usr/share/vdr/rcscript/pre-start-98-wait-conditions.sh index 4c1bbbf..bed8120 100644 --- a/usr/share/vdr/rcscript/pre-start-98-wait-conditions.sh +++ b/usr/share/vdr/rcscript/pre-start-98-wait-conditions.sh @@ -17,4 +17,3 @@ addon_main() { fi return $exitcode } - diff --git a/usr/share/vdr/rcscript/watchdog-restart-20-modules.sh b/usr/share/vdr/rcscript/watchdog-restart-20-modules.sh index a0ad331..e74ed86 100644 --- a/usr/share/vdr/rcscript/watchdog-restart-20-modules.sh +++ b/usr/share/vdr/rcscript/watchdog-restart-20-modules.sh @@ -10,4 +10,3 @@ addon_main() { fi return 0 } - diff --git a/usr/share/vdr/shutdown/periodic-50-epgscan.sh b/usr/share/vdr/shutdown/periodic-50-epgscan.sh index 122495d..08a6e04 100644 --- a/usr/share/vdr/shutdown/periodic-50-epgscan.sh +++ b/usr/share/vdr/shutdown/periodic-50-epgscan.sh @@ -11,4 +11,3 @@ if yesno "${PERIODIC_EPGSCAN}"; then ${SVDRPCMD} SCAN sleep ${PERIODIC_EPGSCAN_DURATION}m fi - diff --git a/usr/share/vdr/shutdown/pre-shutdown-05-time-calculations.sh b/usr/share/vdr/shutdown/pre-shutdown-05-time-calculations.sh index 2b6992f..059841a 100644 --- a/usr/share/vdr/shutdown/pre-shutdown-05-time-calculations.sh +++ b/usr/share/vdr/shutdown/pre-shutdown-05-time-calculations.sh @@ -48,4 +48,3 @@ catch_running_timer if yesno "${FIXED_WAKEUP}"; then calculate_wakeup_timer fi - diff --git a/usr/share/vdr/shutdown/pre-shutdown-20-check-blocking-programs.sh b/usr/share/vdr/shutdown/pre-shutdown-20-check-blocking-programs.sh index 904d33c..fc417c1 100644 --- a/usr/share/vdr/shutdown/pre-shutdown-20-check-blocking-programs.sh +++ b/usr/share/vdr/shutdown/pre-shutdown-20-check-blocking-programs.sh @@ -10,4 +10,3 @@ for PROG in ${SHUTDOWN_CHECK_PROGRAMS} ${SHUTDOWN_CHECK_ADDITIONAL_PROGRAMS}; do break fi done - diff --git a/usr/share/vdr/shutdown/pre-shutdown-40-time.sh b/usr/share/vdr/shutdown/pre-shutdown-40-time.sh index 76aab40..5ca379c 100644 --- a/usr/share/vdr/shutdown/pre-shutdown-40-time.sh +++ b/usr/share/vdr/shutdown/pre-shutdown-40-time.sh @@ -10,4 +10,3 @@ do_check_time() { } do_check_time - diff --git a/usr/share/vdr/shutdown/pre-shutdown-99-periodic-thread.sh b/usr/share/vdr/shutdown/pre-shutdown-99-periodic-thread.sh index 5aa67f3..f0b201b 100644 --- a/usr/share/vdr/shutdown/pre-shutdown-99-periodic-thread.sh +++ b/usr/share/vdr/shutdown/pre-shutdown-99-periodic-thread.sh @@ -3,9 +3,7 @@ PERIODIC_THREAD_ENDTIME=${shutdown_data_dir}/periodic_thread_last_ended - -check_periodic_thread() -{ +check_periodic_thread() { # test if periodic thread is activated yesno "${ENABLE_SHUTDOWN_PERIODIC_JOBS}" || return @@ -44,4 +42,3 @@ check_periodic_thread() } check_periodic_thread - |