Skip to content

Instantly share code, notes, and snippets.

@rwprodev
Last active May 29, 2021 09:19
Show Gist options
  • Select an option

  • Save rwprodev/ea58c9519f45302690b4818051c4d199 to your computer and use it in GitHub Desktop.

Select an option

Save rwprodev/ea58c9519f45302690b4818051c4d199 to your computer and use it in GitHub Desktop.
Script to upgrade Sendy to a new version
#!/usr/bin/sh
if [ "$#" -ne 2 ]; then
echo "Usage: $0 OLD_VERSION NEW_VERSION" >&2
exit 1
fi
export OLD=$1
export NEW=$2
echo Migrating from $OLD to $NEW
cp $OLD/includes/config.php $NEW/includes/
cp $OLD/includes/cors_allow.php $NEW/includes/
cp -r $OLD/uploads/ $NEW
cp $OLD/.htaccess $NEW
# CORS
sed -ie "/includes\/config.php/a \\\tinclude('includes\/cors_allow.php');" $NEW/subscribe.php
sed -ie "/includes\/config.php/a \\\tinclude('includes\/cors_allow.php');" $NEW/unsubscribe.php
#rm public_html
#ln -s $NEW public_html
echo Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment