slackbuilds_ponce/system/swtpm/doinst.sh
K. Eugene Carlson 34f5330662
system/swtpm: Added (libtpms-based TPM emulator)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2022-04-30 13:51:53 +07:00

16 lines
451 B
Bash

config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
# toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
config etc/swtpm_setup.conf.new
config etc/swtpm-localca.conf.new
config etc/swtpm-localca.options.new