diff --git a/logviewer-nginx.conf b/logviewer-nginx.conf new file mode 100644 index 0000000..4aee3f1 --- /dev/null +++ b/logviewer-nginx.conf @@ -0,0 +1,17 @@ +server { + listen 80; + listen [::]:80; + root /; + + location = / { + try_files /logviewer.html 404; + } + + location = /reinstall.log { + try_files $uri 404; + } + + location / { + return 404; + } +} \ No newline at end of file diff --git a/logviewer.html b/logviewer.html new file mode 100644 index 0000000..122e976 --- /dev/null +++ b/logviewer.html @@ -0,0 +1,105 @@ + + + +
+
-EOF
# 显示输出到前台
# script -f /dev/tty0
dev_ttys=$(get_ttys /dev/)
- exec > >(tee -a $dev_ttys /reinstall.html) 2>&1
+ exec > >(tee -a $dev_ttys /reinstall.log) 2>&1
}
extract_env_from_cmdline() {
@@ -235,7 +208,7 @@ mod_motd() {
cat </etc/motd
Reinstalling...
To view logs run:
-tail -fn+1 /reinstall.html
+tail -fn+1 /reinstall.log
EOF
}