aboutsummaryrefslogtreecommitdiff
path: root/send.sh
blob: 7db7c7aac85f3c700812162b5400fb6246291080 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
set -e
# set -x

# Simple shell script to package and send over my dotfiles to a remote machine

package="$(mktemp -d)"

for _f in bashrc mkshrc tmux.conf tmux_helper.sh ; do
	cp "$_f" "$package/.$_f"
done

touch "$package/.tmux.conf.local"

echo "Sending: "
ls -AF "$package" | sed -e's/^/	/'

for host in "$@" ; do
	echo "Operating on host: $host"
	tar -C "$package" -czf - . | ssh "$host" "tar -xzf -"
done

rm -rf "$package"