summaryrefslogtreecommitdiff
path: root/sync.sh
diff options
context:
space:
mode:
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