Skip to content

Instantly share code, notes, and snippets.

@analogic
Created October 9, 2019 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save analogic/59f9eda7f0d50f578b7f72ce87d00076 to your computer and use it in GitHub Desktop.
Save analogic/59f9eda7f0d50f578b7f72ce87d00076 to your computer and use it in GitHub Desktop.
#!/bin/bash
cp -Rp /data/mailserver/log/dmarc/analogic.cz /tmp/dmarc-analogic.cz
cp -Rp /data/mailserver/log/dmarc/ranky.cz /tmp/dmarc-poste.io
cd /tmp/dmarc-analogic.cz
rename 's/humplik\.cz/analogic.cz/g' *
find . -type f -name '*' -exec bash -c 't=$(stat -c %y "$0"); sed -i -e "s/humplik\.cz/analogic.cz/g" "$0"; touch -d "$t" "$0"' {} \;
rm -Rf /data/mailserver-demo/log/dmarc/analogic.cz
mv /tmp/dmarc-analogic.cz /data/mailserver-demo/log/dmarc/analogic.cz
cd /tmp/dmarc-poste.io
rename 's/ranky\.cz/poste.io/g' *
find . -type f -name '*' -exec bash -c 't=$(stat -c %y "$0"); sed -i -e "s/ranky\.cz/poste.io/g" "$0"; touch -d "$t" "$0"' {} \;
rm -Rf /data/mailserver-demo/log/dmarc/poste.io
mv /tmp/dmarc-poste.io /data/mailserver-demo/log/dmarc/poste.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment