-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsync.sh
32 lines (22 loc) · 837 Bytes
/
sync.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
# Bash Strict Mode
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
# Copies the services folder over to the raspberry pi.
# TODO: Check that /mnt/external is actually mounted.
echo Syncing .ssh/
rsync -v -i -e ssh -r ./.ssh/authorized_keys [email protected]:~/.ssh/authorized_keys
# Sleeps required so the remote host doesn't close our new connection while shutting down the previous one.
sleep 1s
echo Syncing install.sh
rsync -v -i -e ssh -r ./install.sh [email protected]:/mnt/external/install.sh
sleep 1s
echo Syncing services/
rsync -v -i -e ssh -r ./services/ [email protected]:/mnt/external/services
# TODO: Reenable this when this
#sleep 1s
#
#echo Running services.
#ssh [email protected] "cd /mnt/external/services ; ./run.sh"
echo Complete