Don't overwrite user modified issue files.
authorValentin Vidic <Valentin.Vidic@CARNet.hr>
Wed, 26 Aug 2009 11:34:51 +0000 (13:34 +0200)
committerValentin Vidic <Valentin.Vidic@CARNet.hr>
Wed, 26 Aug 2009 11:37:29 +0000 (13:37 +0200)
files/etc/issue.expect.lenny [new file with mode: 0644]
files/etc/issue.net.expect.lenny [new file with mode: 0644]
src/functions.sh

diff --git a/files/etc/issue.expect.lenny b/files/etc/issue.expect.lenny
new file mode 100644 (file)
index 0000000..b797604
--- /dev/null
@@ -0,0 +1,2 @@
+Debian GNU/Linux 5.0 \n \l
+
diff --git a/files/etc/issue.net.expect.lenny b/files/etc/issue.net.expect.lenny
new file mode 100644 (file)
index 0000000..ac469c2
--- /dev/null
@@ -0,0 +1 @@
+Debian GNU/Linux 5.0
index 5ec3d81..9040822 100644 (file)
@@ -1240,15 +1240,22 @@ comment_force_overwrite () {
   fi
 }
 
+# try not to overwrite user modified issue files
 fix_issue () {
-  cat > /etc/issue <<EOF
+  if cmp /etc/issue $cnup/files/etc/issue.expect.lenny >/dev/null; then
+    cp -av /etc/issue /etc/issue.$backup_ext
+    cat > /etc/issue <<EOF
 Debian GNU/Linux 5.0 (CARNet Debian 5.0) \\n \\l
 
 EOF
+  fi
 
-  cat > /etc/issue.net <<EOF
+  if cmp /etc/issue.net $cnup/files/etc/issue.net.expect.lenny >/dev/null; then
+    cp -av /etc/issue.net /etc/issue.net.$backup_ext
+    cat > /etc/issue.net <<EOF
 Debian GNU/Linux 5.0 (CARNet Debian 5.0) %h
 EOF
+  fi
 }
 
 check_archives_space() {