summaryrefslogtreecommitdiff
path: root/sync.sh
diff options
context:
space:
mode:
author“Ryder <“r@okfoc.us”>2016-04-14 15:41:46 -0400
committer“Ryder <“r@okfoc.us”>2016-04-14 15:41:46 -0400
commit1634d75ed8b731cb7c0f38e888e3968e7a634c73 (patch)
tree91e0543356272997365b61e26ef00d6641860e2b /sync.sh
parentb278879fa77f3e1a1e1b4a31ac817252fea509ee (diff)
parent822b2d509a0f689efb5ccf2ce378bfa249c9c194 (diff)
Merge branch 'master' of https://github.com/okfocus/portfolio
Diffstat (limited to 'sync.sh')
-rwxr-xr-xsync.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/sync.sh b/sync.sh
new file mode 100755
index 0000000..d01943d
--- /dev/null
+++ b/sync.sh
@@ -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