summaryrefslogtreecommitdiffstats
path: root/setup-sendbug
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2007-09-07 07:28:03 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2007-09-07 07:28:03 +0000
commitf1e147b06e143c36ddc023f5297e3d5a15852466 (patch)
tree9f3272d10e677ac3a822943c7b5f1b0bf1eccce0 /setup-sendbug
parentefcd98845f1e6888ebcd6a55c70206c517b234aa (diff)
downloadalpine-conf-f1e147b06e143c36ddc023f5297e3d5a15852466.tar.bz2
alpine-conf-f1e147b06e143c36ddc023f5297e3d5a15852466.tar.xz
added albootstrap, setup-keymap and replaced setup-problem-reporting with setup-sendbug
Diffstat (limited to 'setup-sendbug')
-rwxr-xr-xsetup-sendbug41
1 files changed, 41 insertions, 0 deletions
diff --git a/setup-sendbug b/setup-sendbug
new file mode 100755
index 0000000..9ce94d8
--- /dev/null
+++ b/setup-sendbug
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+PREFIX=
+. "$PREFIX/lib/libalpine.sh"
+
+conf="$ROOT/etc/sendbug/sendbug.conf"
+
+cfgval() {
+ awk -F= "/^$1/ {print \$2}" "$ROOT/etc/ssmtp/ssmtp.conf" 2>/dev/null
+}
+
+email=$(awk -F= '/^mailfrom/ {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 ^mailfrom "$conf" > /dev/null 2>&1; then
+ sed -i "s/^mailfrom.*/mailfrom=$email/" "$conf"
+else
+ mkdir -p $(dirname "$conf")
+ echo "mailfrom=$email" >> "$conf"
+fi
+
+setup-mta
+
+echo ""
+echo "Please run 'sendbug' to submit problem reports"
+