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... } copy_mirror_file() { ARCH=$(uname -m) case $ARCH in x86-64|x86_64|X86-64|X86_64) SRCMIRROR=mirrors-x86_64.sample ;; aarch64) SRCMIRROR=mirrors-aarch64.sample ;; *) SRCMIRROR=mirrors-x86_64.sample ;; esac #cp usr/doc/slackpkg-@VERSION@/$SRCMIRROR etc/slackpkg.bluebanquise/mirrors.new } copy_mirror_file config etc/slackpkg.bluebanquise/mirrors.new config etc/slackpkg.bluebanquise/slackpkg.conf.new config etc/slackpkg.bluebanquise/blacklist.new rm -f var/lib/slackpkg.bluebanquise/ChangeLog.txt rm -f var/lib/slackpkg.bluebanquise/pkglist rm -f var/lib/slackpkg.bluebanquise/CHECKSUMS.md5*