Compare commits

...

2 Commits

Author SHA1 Message Date
Ray Elliott 20075ec132 add server-install-base.sh commands 2020-06-08 21:17:30 +01:00
Ray Elliott 87392bb0d9 update 2020-06-08 21:16:18 +01:00
6 changed files with 33 additions and 4 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. If none given script will exit.
Scripts that operate on local/remote servers simultaneously (e.g, Using 'local' will
`wp-duplicarte.sh`) do not require this argument.sh 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

View File

@ -1,8 +1,7 @@
#!/bin/sh #!/bin/sh
apt upgrade || exit 10 apt upgrade || exit 10
apt install -y tmux ufw || exit 15 apt install -y tmux ufw || exit 15
ufw allow ssh || exit 20 ufw allow ssh || exit 20
ufw enable yes | ufw enable