-# add sysctl.conf Debian headers
-rm -f /etc/sysctl.conf-head
-cat > /etc/sysctl.conf-head <<EOF
-#
-# /etc/sysctl.conf - Configuration file for setting system variables
-# See sysctl.conf (5) for information.
-#
-EOF
-
-# merge old and new in one conf, primarily respecting old
-script='
-my %confhash = ();
-my ($key, $value);
-while (<>)
-{
- chomp();
- if (/^\s*(\S+)\s*=\s*(.+)\s*$/o)
- {
- my ($key, $value) = ($1, $2);
- $key =~ s/\//./go;
- $confhash{$key} = $value;
- }
-}
-for (sort { $a cmp $b } keys %confhash)
-{
- print $_, "=", $confhash{$_}, "\n";
-}
-'
-rm -f /etc/sysctl.conf-new
-perl -e "$script" < /etc/sysctl.conf.$$ > /etc/sysctl.conf-new
-cat /etc/sysctl.conf-head /etc/sysctl.conf-new > /etc/sysctl.conf.$$
-rm -f /etc/sysctl.conf-head /etc/sysctl.conf-new
-