Revision 25567,
1.8 KB
checked in by jdreed, 13 years ago
(diff) |
Actually add the install.log queries, instead of just adding them to the 'queries' output.
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | # |
---|
3 | # This is largely inspired by/stolen from the "httpd" script in |
---|
4 | # "save-logs" in the "installation-report" package, which is licensed |
---|
5 | # under GPLv2 (as of installation-report-2.44ubuntu1, which was |
---|
6 | # current when this was written). This script is, therefore, licensed |
---|
7 | # under GPLv2. |
---|
8 | # |
---|
9 | PORT=49155 |
---|
10 | DOCROOT=/var/log |
---|
11 | |
---|
12 | run_nc () { |
---|
13 | nc -p $PORT -l -e $1 </dev/null >/dev/null 2>/dev/null & |
---|
14 | } |
---|
15 | |
---|
16 | if [ -z "$ATHINFOD_STARTED" ]; then |
---|
17 | [ -f /var/lib/athinfod_stop ] && exit |
---|
18 | ATHINFOD_STARTED=1 |
---|
19 | export ATHINFOD_STARTED |
---|
20 | # daemonize |
---|
21 | run_nc $0 |
---|
22 | exit |
---|
23 | else |
---|
24 | # start up the next listener process |
---|
25 | [ -f /var/lib/athinfod_stop ] || run_nc $0 |
---|
26 | fi |
---|
27 | |
---|
28 | read query |
---|
29 | query="$(echo "$query" | sed 's/[^-.A-Za-z0-9_]//g')" # untaint |
---|
30 | |
---|
31 | case "$query" in |
---|
32 | version) |
---|
33 | echo "Installation in progress" && test -f /debathena/install-info && cat /debathena/install-info ;; |
---|
34 | uname) |
---|
35 | uname -a ;; |
---|
36 | preseed) |
---|
37 | grep -v "^d-i passwd/root-password" /debathena/preseed ;; |
---|
38 | syslog) |
---|
39 | tail -20 /var/log/syslog ;; |
---|
40 | syslog-full) |
---|
41 | cat /var/log/syslog ;; |
---|
42 | hardware) |
---|
43 | cat /sys/class/dmi/id/product_name ;; |
---|
44 | uptime) |
---|
45 | uptime ;; |
---|
46 | install.log) |
---|
47 | tail -20 /target/var/log/athena-install.log ;; |
---|
48 | install.log-full) |
---|
49 | cat /target/var/log/athena-install.log ;; |
---|
50 | *) |
---|
51 | [ "$query" != "queries" ] && echo "Unknown query" |
---|
52 | cat <<EOF |
---|
53 | version echo "Installation in progress" && test -f /debathena/install-info && cat /debathena/install-info |
---|
54 | uname uname -a |
---|
55 | preseed grep -v "^d-i passwd/root-password" /debathena/preseed |
---|
56 | syslog tail -20 /var/log/syslog |
---|
57 | syslog-full cat /var/log/syslog |
---|
58 | hardware cat /sys/class/dmi/id/product_name |
---|
59 | uptime uptime |
---|
60 | install.log tail -20 /target/var/log/athena-install.log |
---|
61 | install.log-full cat /target/var/log/athena-install.log |
---|
62 | EOF |
---|
63 | esac |
---|
64 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.