blob: afbf8d8a268d7a371d03419d747fd69fa797a880 (
plain)
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
|
#!/bin/bash
set -e
echo $SSH_KEY | base64 -d >> /tmp/key
chmod -R 0600 /tmp/key
rsync -e "ssh -i /tmp/key -o StrictHostKeyChecking=no" -avz --delete ./systemd/ $RSYNC_DESTINATION/.config/systemd/user/
cd dist
for item in *; do
echo "copying $item"
if [ -d "$item" ]; then
SOURCE_PATH="$item/"
DEST_PATH="$RSYNC_DESTINATION/$item/"
else
SOURCE_PATH="$item"
DEST_PATH="$RSYNC_DESTINATION"
fi
rsync -e "ssh -i /tmp/key -o StrictHostKeyChecking=no" -avz --delete $SOURCE_PATH $DEST_PATH
done
cd ..
echo "finished copying to remote host..."
ssh -i /tmp/key -o StrictHostKeyChecking=no $(echo "${RSYNC_DESTINATION%%:*}") "systemctl daemon-reload --user ; systemctl stop --user fruitvote ; systemctl start --user fruitvote"
echo "reloading fruitvote..."
rm /tmp/key
|