diff options
Diffstat (limited to 'sync.sh')
| -rwxr-xr-x | sync.sh | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -0,0 +1,17 @@ +user=okfocus +server=portfolio.sup.land +dir=/home/okfocus/portfolio + +if [[ "$1" == push ]]; then + read -r -p "You're about to overwrite the remote db. Sure you wanna do that? [y/n] " response + if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then + echo Pushing db.json to $server... + scp db.json $user@$server:$dir + else + echo Aborting... + exit 0; + fi +elif [[ "$1" == pull ]]; then + echo Pulling db.json from $server... + scp $user@$server:$dir/db.json . +fi |
