| 1 |
#!/bin/sh |
| 2 |
# postinst script for mythtv-status |
| 3 |
# |
| 4 |
# see: dh_installdeb(1) |
| 5 |
|
| 6 |
PACKAGE=mythtv-status |
| 7 |
|
| 8 |
. /usr/share/debconf/confmodule |
| 9 |
|
| 10 |
set -e |
| 11 |
|
| 12 |
case "$1" in |
| 13 |
configure|reconfigure) |
| 14 |
DEBIANCONFIG=/etc/default/$PACKAGE |
| 15 |
|
| 16 |
# Default to --email-only-on-alert but allow it be unset in the config file. |
| 17 |
EMAIL_ARGS="--email-only-on-alert" |
| 18 |
|
| 19 |
# load current settings, most of which will be overwritten. |
| 20 |
[ -f $DEBIANCONFIG ] && . $DEBIANCONFIG |
| 21 |
|
| 22 |
db_get $PACKAGE/host |
| 23 |
HOST="${RET:-localhost}" |
| 24 |
|
| 25 |
db_get $PACKAGE/enable |
| 26 |
UPDATE_MOTD="${RET:-true}" |
| 27 |
|
| 28 |
[ $UPDATE_MOTD = 'true' ] && UPDATE_MOTD='yes' |
| 29 |
|
| 30 |
# Support the old variable name. |
| 31 |
[ "x$RUN" != "x" ] && UPDATE_MOTD=$RUN |
| 32 |
|
| 33 |
# Support the old variable name. |
| 34 |
[ "x$ARGS" != "x" ] && UPDATE_MOTD_ARGS=$ARGS |
| 35 |
|
| 36 |
db_get $PACKAGE/email |
| 37 |
EMAIL="${RET:-none}" |
| 38 |
|
| 39 |
cat <<_eof > $DEBIANCONFIG |
| 40 |
# $PACKAGE Debian configuration |
| 41 |
# |
| 42 |
# You can run 'dpkg-reconfigure $PACKAGE' to modify the values in this |
| 43 |
# file, if you want. You can also change the values here and changes will |
| 44 |
# be preserved. But other changes will not be preserved. |
| 45 |
# |
| 46 |
# Do note that only the values are preserved; the rest of the file is |
| 47 |
# rewritten. |
| 48 |
# |
| 49 |
|
| 50 |
# HOST: |
| 51 |
# What host should we check the status on? |
| 52 |
HOST=$HOST |
| 53 |
|
| 54 |
######################################################################## |
| 55 |
# The following settings are used by the /etc/init.d/mythtv-status and # |
| 56 |
# mythtv-update-motd scripts to update the MOTD. # |
| 57 |
######################################################################## |
| 58 |
|
| 59 |
# UPDATE_MOTD: |
| 60 |
# Should we actually run and update the MOTD? |
| 61 |
UPDATE_MOTD=$UPDATE_MOTD |
| 62 |
|
| 63 |
# UPDATE_MOTD_ARGS: |
| 64 |
# Any extra arguments to pass to mythtv-status (i.e., -e -d). |
| 65 |
UPDATE_MOTD_ARGS="$UPDATE_MOTD_ARGS" |
| 66 |
|
| 67 |
######################################################################## |
| 68 |
# The following settings are used by the /etc/cron.daily/mythtv-status # |
| 69 |
# script when generating the daily status email report. # |
| 70 |
######################################################################## |
| 71 |
|
| 72 |
# EMAIL: |
| 73 |
# A comma separated list of email address to send status emails to. |
| 74 |
# |
| 75 |
# Set to none to disable daily emails, if empty then default to root. |
| 76 |
EMAIL=$EMAIL |
| 77 |
|
| 78 |
# EMAIL_ARGS: |
| 79 |
# Command line arguments that are used when sending the daily email. |
| 80 |
EMAIL_ARGS="$EMAIL_ARGS" |
| 81 |
_eof |
| 82 |
|
| 83 |
db_stop |
| 84 |
;; |
| 85 |
esac |
| 86 |
|
| 87 |
# dh_installdeb will replace this with shell code automatically |
| 88 |
# generated by other debhelper scripts. |
| 89 |
|
| 90 |
#DEBHELPER# |
| 91 |
|
| 92 |
exit 0 |