diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2007-04-06 22:09:21 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2007-04-06 22:09:21 +0000 |
commit | e73092f041d230a43cb400b8de5ed1b9cc11ff04 (patch) | |
tree | 6254c626f8c790cd9ac032285d0d621ef4462262 /setup-problem-reporting | |
parent | b183abaaa5f56cf26e79c8e3e3f7081ba05b3fff (diff) | |
download | alpine-conf-e73092f041d230a43cb400b8de5ed1b9cc11ff04.zip |
added setup-mta and setup-problem-reporting
Diffstat (limited to 'setup-problem-reporting')
-rwxr-xr-x | setup-problem-reporting | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/setup-problem-reporting b/setup-problem-reporting new file mode 100755 index 0000000..0b24a30 --- /dev/null +++ b/setup-problem-reporting @@ -0,0 +1,40 @@ +#!/bin/sh + +PREFIX= +. "$PREFIX/lib/libalpine.sh" + +conf="$ROOT/etc/gnats/send-pr.conf" + +cfgval() { + awk -F= "/^$1/ {print \$2}" "$ROOT/etc/ssmtp/ssmtp.conf" 2>/dev/null +} + +email=$(awk -F= '/^FROM/ {print $2}' "$conf" 2>/dev/null) + +if [ -z "$email" ] ; then + hostname=$(cfgval hostname) + if [ -z "$hostname" ]; then + hostname=$(hostname -f 2>/dev/null || cat /etc/hostname) + fi +else + hostname=$(hostname -f 2>/dev/null || cat /etc/hostname) +fi +domain=$(hostname -d $hostname 2>/dev/null) +if [ -n "$hostname" -a -z "$email" ] ; then + email=$(whoami)@$hostname +fi + +echon "Sender email address for problem reports? [$email] " +default_read email $email + +if grep ^FROM "$conf" > /dev/null ; then + sed -i "s/FROM.*/FROM=$email/" "$conf" +else + echo "FROM=$email" >> "$conf" +fi + +setup-mta + +echo "" +echo "Please run 'send-pr' to submit problem reports" + |