This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /dev/ci/setup_ssh.sh | |
#!/usr/bin/env bash | |
which ssh-agent || (apt-get update -y && apt-get install openssh-client -y) | |
eval $(ssh-agent -s) | |
ssh-add <(echo "$PLATFORMSH_DEPLOY_KEY") | |
mkdir -p ~/.ssh | |
[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @oldsite='http://oldsite.com'; | |
SET @newsite='http://newsite.com'; | |
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite); | |
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite); | |
/* only uncomment next line if you want all your current posts to post to RSS again as new */ | |
#UPDATE wp_posts SET guid = replace(guid, @oldsite, @newsite); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# delete node | |
find . -name modules.xml | xargs xmlstarlet ed -L -d '//node' | |
# update attribute | |
find . -name modules.xml | xargs xmlstarlet ed -L -u '//node/@attr' -v 'value' | |
# indent with 4 spaces | |
for i in $(find . -name 'modules.xml'); do xmlstarlet fo -s 4 "$i" > "$i.tmp"; mv "$i.tmp" "$i"; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
clear | |
echo "============================================" | |
echo "WordPress Install Script" | |
echo "============================================" | |
echo "Do you need to setup new MySQL database? (y/n)" | |
read -e setupmysql | |
if [ "$setupmysql" == y ] ; then | |
echo "MySQL Admin User: " | |
read -e mysqluser |
NewerOlder