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/ipsec.conf.new
config etc/ipsec.secrets.new
config etc/swanctl/swanctl.conf.new
config etc/strongswan.d/charon/aesni.conf.new
config etc/strongswan.d/charon/aes.conf.new
config etc/strongswan.d/charon/des.conf.new
config etc/strongswan.d/charon/rc2.conf.new
config etc/strongswan.d/charon/sha2.conf.new
config etc/strongswan.d/charon/sha3.conf.new
config etc/strongswan.d/charon/sha1.conf.new
config etc/strongswan.d/charon/md5.conf.new
config etc/strongswan.d/charon/mgf1.conf.new
config etc/strongswan.d/charon/random.conf.new
config etc/strongswan.d/charon/nonce.conf.new
config etc/strongswan.d/charon/x509.conf.new
config etc/strongswan.d/charon/revocation.conf.new
config etc/strongswan.d/charon/constraints.conf.new
config etc/strongswan.d/charon/pubkey.conf.new
config etc/strongswan.d/charon/pkcs1.conf.new
config etc/strongswan.d/charon/pkcs7.conf.new
config etc/strongswan.d/charon/pkcs8.conf.new
config etc/strongswan.d/charon/pkcs12.conf.new
config etc/strongswan.d/charon/pgp.conf.new
config etc/strongswan.d/charon/dnskey.conf.new
config etc/strongswan.d/charon/sshkey.conf.new
config etc/strongswan.d/charon/dnscert.conf.new
config etc/strongswan.d/charon/pem.conf.new
config etc/strongswan.d/charon/openssl.conf.new
config etc/strongswan.d/charon/gcrypt.conf.new
config etc/strongswan.d/charon/af-alg.conf.new
config etc/strongswan.d/charon/fips-prf.conf.new
config etc/strongswan.d/charon/gmp.conf.new
config etc/strongswan.d/charon/curve25519.conf.new
config etc/strongswan.d/charon/xcbc.conf.new
config etc/strongswan.d/charon/cmac.conf.new
config etc/strongswan.d/charon/hmac.conf.new
config etc/strongswan.d/charon/drbg.conf.new
config etc/strongswan.d/charon/curl.conf.new
config etc/strongswan.d/charon/files.conf.new
config etc/strongswan.d/charon/sqlite.conf.new
config etc/strongswan.d/charon/attr.conf.new
config etc/strongswan.d/charon/attr-sql.conf.new
config etc/strongswan.d/charon/kernel-netlink.conf.new
config etc/strongswan.d/charon/resolve.conf.new
config etc/strongswan.d/charon/socket-default.conf.new
config etc/strongswan.d/charon/bypass-lan.conf.new
config etc/strongswan.d/charon/connmark.conf.new
config etc/strongswan.d/charon/farp.conf.new
config etc/strongswan.d/charon/stroke.conf.new
config etc/strongswan.d/charon/vici.conf.new
config etc/strongswan.d/charon/sql.conf.new
config etc/strongswan.d/charon/updown.conf.new
config etc/strongswan.d/charon/eap-identity.conf.new
config etc/strongswan.d/charon/eap-sim.conf.new
config etc/strongswan.d/charon/eap-sim-file.conf.new
config etc/strongswan.d/charon/eap-aka.conf.new
config etc/strongswan.d/charon/eap-aka-3gpp.conf.new
config etc/strongswan.d/charon/eap-simaka-sql.conf.new
config etc/strongswan.d/charon/eap-simaka-pseudonym.conf.new
config etc/strongswan.d/charon/eap-simaka-reauth.conf.new
config etc/strongswan.d/charon/eap-mschapv2.conf.new
config etc/strongswan.d/charon/eap-radius.conf.new
config etc/strongswan.d/charon/eap-tls.conf.new
config etc/strongswan.d/charon/eap-ttls.conf.new
config etc/strongswan.d/charon/xauth-generic.conf.new
config etc/strongswan.d/charon/xauth-eap.conf.new
config etc/strongswan.d/charon/dhcp.conf.new
config etc/strongswan.d/charon/ext-auth.conf.new
config etc/strongswan.d/charon/lookip.conf.new
config etc/strongswan.d/charon/coupling.conf.new
config etc/strongswan.d/charon/unity.conf.new
config etc/strongswan.d/charon/counters.conf.new
config etc/strongswan.d/pool.conf.new
config etc/strongswan.d/charon.conf.new
config etc/strongswan.d/charon-logging.conf.new
config etc/strongswan.d/starter.conf.new
config etc/strongswan.d/scepclient.conf.new
config etc/strongswan.d/pki.conf.new
config etc/strongswan.d/swanctl.conf.new
config etc/strongswan.conf.new
( cd usr/lib/ipsec ; rm -rf libcharon.so )
( cd usr/lib/ipsec ; ln -sf libcharon.so.0.0.0 libcharon.so )
( cd usr/lib/ipsec ; rm -rf libcharon.so.0 )
( cd usr/lib/ipsec ; ln -sf libcharon.so.0.0.0 libcharon.so.0 )
( cd usr/lib/ipsec ; rm -rf libradius.so )
( cd usr/lib/ipsec ; ln -sf libradius.so.0.0.0 libradius.so )
( cd usr/lib/ipsec ; rm -rf libradius.so.0 )
( cd usr/lib/ipsec ; ln -sf libradius.so.0.0.0 libradius.so.0 )
( cd usr/lib/ipsec ; rm -rf libsimaka.so )
( cd usr/lib/ipsec ; ln -sf libsimaka.so.0.0.0 libsimaka.so )
( cd usr/lib/ipsec ; rm -rf libsimaka.so.0 )
( cd usr/lib/ipsec ; ln -sf libsimaka.so.0.0.0 libsimaka.so.0 )
( cd usr/lib/ipsec ; rm -rf libstrongswan.so )
( cd usr/lib/ipsec ; ln -sf libstrongswan.so.0.0.0 libstrongswan.so )
( cd usr/lib/ipsec ; rm -rf libstrongswan.so.0 )
( cd usr/lib/ipsec ; ln -sf libstrongswan.so.0.0.0 libstrongswan.so.0 )
( cd usr/lib/ipsec ; rm -rf libtls.so )
( cd usr/lib/ipsec ; ln -sf libtls.so.0.0.0 libtls.so )
( cd usr/lib/ipsec ; rm -rf libtls.so.0 )
( cd usr/lib/ipsec ; ln -sf libtls.so.0.0.0 libtls.so.0 )
( cd usr/lib/ipsec ; rm -rf libvici.so )
( cd usr/lib/ipsec ; ln -sf libvici.so.0.0.0 libvici.so )
( cd usr/lib/ipsec ; rm -rf libvici.so.0 )
( cd usr/lib/ipsec ; ln -sf libvici.so.0.0.0 libvici.so.0 )
