-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBS
executable file
·35 lines (31 loc) · 1.1 KB
/
BS
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
33
34
35
#! /bin/bash
# bootstrap a new box with my setup
[[ -f secrets ]] && source secrets
[[ -n BS.aux ]] && AUX=`cat BS.aux`
for REM in "$@"; do
# make sure github.com's ssh key is known so the clone doesn't ask
# clone my dotfile repo
# else pull it if already cloned
for cmd in \
'uptime' \
'test -d ~/src || mkdir ~/src' \
'test -d ~/.ssh || mkdir ~/.ssh && chmod 700 ~/.ssh' \
'grep -sq github.com ~/.ssh/known_hosts || ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts' \
"$AUX" \
'cd ~/src; test -d dotfile || git clone [email protected]:roymarantz/dotfile.git' \
'cd ~/src/dotfile; git pull;' \
'cd ~/src; test -d tumblr-dotfiles || git clone git@${TGITH}:marantz/tumblr-dotfiles.git' \
'cd ~/src/dotfile; git pull;' \
'cd ~/src/dotfile; ./INSTALL ${FORCE}'
do
echo ssh -n "'$REM'" "'$cmd'"
$DEB ssh -n "$REM" "$cmd"
done
done
exit # not using the for now
puppet recipe needs work
echo 'running puppet'
ssh -t "$REM" 'cd ~/src/dotfile;
test -r marantz.pp
&& sudo puppet apply ./marantz.pp
|| echo not running puppet'