Moved metche.cron.d metche.config metche.templates metche.postinst to more sexy cron.d config templates postinst.
ricola
18 years ago
0 | #!/bin/sh | |
1 | ||
2 | CONFIGFILE=/etc/metche.conf | |
3 | set -e | |
4 | . /usr/share/debconf/confmodule | |
5 | ||
6 | if [ -e $CONFIGFILE ]; then | |
7 | . $CONFIGFILE || true | |
8 | db_set metche/email $EMAIL_ADDRESS | |
9 | if [ "$CHANGELOG_FILE" ]; then | |
10 | db_set metche/changelog/file $CHANGELOG_FILE | |
11 | fi | |
12 | if [ "$CHANGELOG_DIR" ]; then | |
13 | db_set metche/changelog/directory $CHANGELOG_DIR | |
14 | fi | |
15 | fi | |
16 | ||
17 | db_input medium metche/email || true | |
18 | db_input medium metche/changelog/type || true | |
19 | db_go || true | |
20 | db_get metche/changelog/type | |
21 | case "$RET" in | |
22 | "Single changelog file") | |
23 | db_input medium metche/changelog/file || true | |
24 | db_go || true | |
25 | ;; | |
26 | "Multiple changelog files") | |
27 | db_input medium metche/changelog/directory || true | |
28 | db_go || true | |
29 | ;; | |
30 | esac |
0 | 0-59/5 * * * * root test -x /usr/sbin/metche && /usr/sbin/metche cron |
0 | #!/bin/sh | |
1 | ||
2 | CONFIGFILE=/etc/metche.conf | |
3 | set -e | |
4 | . /usr/share/debconf/confmodule | |
5 | ||
6 | db_get metche/email | |
7 | EMAIL_ADDRESS="$RET" | |
8 | db_get metche/changelog/type | |
9 | case "$RET" in | |
10 | "Single changelog file") | |
11 | db_get metche/changelog/file | |
12 | CHANGELOG_FILE="$RET" | |
13 | ;; | |
14 | "Multiple changelog files") | |
15 | db_get metche/changelog/directory | |
16 | CHANGELOG_DIR="$RET" | |
17 | ;; | |
18 | esac | |
19 | ||
20 | cp -a -f $CONFIGFILE $CONFIGFILE.tmp | |
21 | if [ "$CHANGELOG_FILE" ]; then | |
22 | sed -e "s/^ *EMAIL_ADDRESS=.*/EMAIL_ADDRESS=\"$EMAIL_ADDRESS\"/" \ | |
23 | -e "s@^[# ]*CHANGELOG_FILE=.*@CHANGELOG_FILE=\"$CHANGELOG_FILE\"@" \ | |
24 | -e "s@^[# ]*CHANGELOG_DIR@#CHANGELOG_DIR@" < $CONFIGFILE > $CONFIGFILE.tmp | |
25 | fi | |
26 | if [ "$CHANGELOG_DIR" ]; then | |
27 | sed -e "s/^ *EMAIL_ADDRESS=.*/EMAIL_ADDRESS=\"$EMAIL_ADDRESS\"/" \ | |
28 | -e "s@^[# ]*CHANGELOG_DIR=.*@CHANGELOG_DIR=\"$CHANGELOG_DIR\"@" \ | |
29 | -e "s@^[# ]*CHANGELOG_FILE@#CHANGELOG_FILE@" < $CONFIGFILE > $CONFIGFILE.tmp | |
30 | fi | |
31 | mv -f $CONFIGFILE.tmp $CONFIGFILE | |
32 | ||
33 | metche cron |
0 | Template: metche/email | |
1 | Type: string | |
2 | Default: root | |
3 | Description: Email address to which the reports will be sent. | |
4 | By default, metche is run periodically by a cron job which returns | |
5 | reports containing changes made to: | |
6 | - the changelog files, | |
7 | - the watched files, | |
8 | - the list of installed debian packages. | |
9 | This option indicates to which email address those reports will be | |
10 | sent and typically corresponds to your collective mailing-list | |
11 | address. | |
12 | . | |
13 | See https://poivron.org/dev/metche/ for an example. | |
14 | . | |
15 | Note: metche is also able to use GnuPG to encrypt the email it sends, | |
16 | but does not by default. See the man page and the configuration file | |
17 | for more details. | |
18 | ||
19 | Template: metche/changelog/type | |
20 | Type: select | |
21 | Choices: Single changelog file, Multiple changelog files | |
22 | Description: Changelog monitoring type. | |
23 | Metche monitors changelog files written by *you* and which should | |
24 | comment the changes you made to the system. You can choose between | |
25 | two different types of monitoring: | |
26 | - Single changelog file monitoring or | |
27 | - Multiple changelogs file monitoring, in which each "Changelog" | |
28 | file in a sub-directory of a given directory will be monitored. | |
29 | ||
30 | Template: metche/changelog/file | |
31 | Type: string | |
32 | Description: Changelog file to be monitored. | |
33 | This option sets the path of the changelog file to be monitored. | |
34 | ||
35 | Template: metche/changelog/directory | |
36 | Type: string | |
37 | Description: Changelog directory to be monitored. | |
38 | This option sets the path of the changelog directory. Each | |
39 | "Changelog" file should be in a sub-directory of this directory. |