summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMike Crute <mike@crute.us>2020-07-27 18:35:53 +0000
committerMike Crute <mike@crute.us>2020-07-27 18:36:24 +0000
commit470e5efcb48b390b2e5ead9325b464de65225530 (patch)
treeed1417f62900601db9953baae6792bdc050acfc3 /bin
parentc4830900cd56aef6fb63f64a3c001b6a4df498a3 (diff)
downloaddotfiles-470e5efcb48b390b2e5ead9325b464de65225530.tar.bz2
dotfiles-470e5efcb48b390b2e5ead9325b464de65225530.tar.xz
dotfiles-470e5efcb48b390b2e5ead9325b464de65225530.zip
Add remote bird script and ignores
Diffstat (limited to 'bin')
-rwxr-xr-xbin/remote-birdc24
1 files changed, 24 insertions, 0 deletions
diff --git a/bin/remote-birdc b/bin/remote-birdc
new file mode 100755
index 0000000..57d6d39
--- /dev/null
+++ b/bin/remote-birdc
@@ -0,0 +1,24 @@
1#/bin/bash
2
3if [ -z "$1" ]; then
4 echo "usage: $(basename $0) <hostname>"
5 exit 1
6fi
7
8TD=$(mktemp -d)
9
10trap "rm -rf $TD" EXIT ERR
11# Terminal will be in a funky state if we uncleanly exit from birdc
12trap "reset; rm -rf $TD" INT TERM
13
14ssh -nNT -oStreamLocalBindUnlink=yes -L $TD/bird.sock:/var/run/bird.ctl $1 > /dev/null 2>&1 &
15SSH_PID=$!
16
17sleep 5
18
19birdc -s $TD/bird.sock
20
21echo "*** Done... cleaning up"
22
23kill -s TERM $SSH_PID >/dev/null 2>&1
24wait $SSH_PID