5 #This checks whether there is a newline at the end of the file and adds one if there was not.
6 #Needed because sed deletes the last line if it does not end with a newline
8 perl -e 'use strict;' \
10 -e 'open(my $in, "<", "/usr/share/policy/etc/current/pulse/xpolicy.conf") or die "Cannot open /usr/share/policy/etc/current/pulse/xpolicy.conf: $!";' \
11 -e 'my @lines = <$in>;' \
12 -e 'my $lastlineishere = $#lines;' \
13 -e 'my $lastline = $lines[$lastlineishere];' \
14 -e 'unless ($lastline =~ /\n$/){open(my $log, ">>", "/usr/share/policy/etc/current/pulse/xpolicy.conf") or die "Cannot open /usr/share/policy/etc/current/pulse/xpolicy.conf: $!"; print $log "\n"; }'
16 #This removes three subsequent lines from xpolicy.conf if they all match (the lines added by the postinstall script)
22 #search for KitchenAlert on the second line
23 /\nexe\t= KitchenAlert/ {
28 #s/'[stream]'.*alarm//
30 }}}' /usr/share/policy/etc/current/pulse/xpolicy.conf