This commit is contained in:
Ray Elliott 2020-06-08 21:16:18 +01:00
parent 6f06eba56e
commit 87392bb0d9
5 changed files with 32 additions and 2 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
config
config-urls

View File

@ -2,5 +2,11 @@ All scripts require an argument to specify 'local' or 'remote'.
If none given script will exit.
Scripts that operate on local/remote servers simultaneously (e.g,
`wp-duplicarte.sh`) do not require this argument.sh
Using 'local' will
set the source server URL to `$local_url`.
set the destination server URL to `$remote_url`.
Using 'remote' will
set the source server URL to `$remote_url`.
set the destination server URL to `$local_url`.

4
config-urls-example Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
export local_url=''
export remote_url=''

18
run.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
. ./config-urls
if [ "$1" = 'local' ] ; then
( export local_url="$local_url"; \
export remote_url="$remote_url"; \
cat config "$2" \
) | ssh root@"$local_url" -T /bin/sh
elif [ "$1" = 'remote' ] ; then
( export local_url="$remote_url"; \
export remote_url="$local_url"; \
cat config "$2" \
) | ssh root@"$remote_url" -T /bin/sh
else
echo "error: must specify local or remote"
fi