From 8030e36bcd67810da3c03191b7e730eeb16ea999 Mon Sep 17 00:00:00 2001 From: Brett Petch Date: Sun, 5 Feb 2023 09:05:06 -0500 Subject: [PATCH] feature: basic webhook support --- migration.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/migration.sh b/migration.sh index 7e3028e..2864bce 100644 --- a/migration.sh +++ b/migration.sh @@ -4,6 +4,9 @@ # Only use on shared slots. # Licensed under GNU General Public License v3.0 # Logs stored at $HOME/.logs/migration.log + +#webhook="https://slack.com/blah" + mkdir -p "$HOME/.logs/" export log="$HOME/.logs/migration.log" touch "$log" @@ -123,6 +126,10 @@ EOF done echo "Copying data from $HOME to ${newhost}:\$HOME/old... This could take some time." rsync -ahH --info=progress2 "$HOME/" "${newuser}@${newhost}:old/" -e 'ssh -p22' + echo "Migration Complete" + if [[ -n $webhook ]]; then + curl -X POST -d '{"type": "section", "text": { "type": "mrkdwn", "text": "Migration complete for '$USER'!" }}' $webhook + fi } function runner() {