-
Notifications
You must be signed in to change notification settings - Fork 1
/
debtrack.sh
executable file
·68 lines (58 loc) · 1.41 KB
/
debtrack.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
#
# $Id$
#
# Debian package installation tracking - framework
#
. /etc/debtrack.conf
echo "ABPSoft Debian Package Tracker v0.05"
echo ""
if [ ! -d "$BIN" ]; then
echo "No debtrack directory $BIN - bailing out."
exit 1
fi
if [ ! -d "$VAR" ]; then
echo "No debtrack directory $VAR - bailing out."
exit 1
fi
echo "What debdiff thinks about this system:"
echo "-------------------------------------------------------------------------"
"$BIN/debdiff.sh" || exit
echo "-------------------------------------------------------------------------"
echo -n "Post a report? [Y/n]: "
read yn
if [ -z "$yn" -o "$yn" = "y" -o "$yn" = "Y" ]; then
echo -n "Maintainer name? [$MAINTAINER]: "
read mname
if [ -z "$mname" ]; then
mname="$MAINTAINER"
fi
echo -n "Statement? [Regular security update]: "
read stmt
if [ -z "$stmt" ]; then
stmt="Regular security update"
fi
echo -n "Mail destination? [$MDST]: "
read mdst
if [ -z "$mdst" ]; then
mdst="$MDST"
fi
echo "Posting report from $mname to $mdst..."
(
echo "Host: $HOST"
echo -n "Date: "
date +"%Y-%m-%d %H:%M:%S"
echo "Maintainer: $mname"
echo "Statement: $stmt"
echo ""
"$BIN/debdiff.sh"
if [ -x "$BIN/show-tech-support.sh" ]; then
"$BIN/show-tech-support.sh"
fi
) | mail -s "debtrack report for $HOST" $mdst
fi
echo -n "Update checkpoint now? [Y/n]: "
read yn
if [ -z "$yn" -o "$yn" = "y" -o "$yn" = "Y" ]; then
"$BIN/debcheckpoint.sh"
fi