-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·62 lines (53 loc) · 1.29 KB
/
bootstrap.sh
File metadata and controls
executable file
·62 lines (53 loc) · 1.29 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env zsh
SETUPREPO="https://github.com/StreamOfRon/setup.git"
SETUPDIR="${HOME}/.setup"
OS=$(uname)
case "${OS}" in
"Darwin")
BREW=$(which brew)
if [[ ! -x $BREW || $? -eq 1 ]] ; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if [ -x /usr/local/bin/brew ] ; then
BREW="/usr/local/bin/brew"
elif [ -x /opt/homebrew/bin/brew ] ; then
BREW="/opt/homebrew/bin/brew"
else
echo "Still can't find homebrew, aborting..."
exit 1
fi
echo "eval \"$(${BREW} shellenv)\"" >> ~/.zprofile
eval "$(${BREW} shellenv)"
fi
NONINTERACTIVE=1
$BREW install ansible flock
;;
"Linux")
SUPPORTED=('apt' 'pamac')
PKGMGR=""
for name in $SUPPORTED ; do
PKGMGR=$(which ${name})
if [[ $? == 0 ]] ; then
case "${name}" in
"apt")
sudo $PKGMGR update
sudo $PKGMGR install ansible
;;
"pamac")
$PKGMGR update
$PKGMGR install ansible flock
;;
*)
echo "No supported package manager for Linux detected"
exit 1
;;
esac
fi
done
;;
*)
echo "Unknown OS environment: ${OS}"
exit 1
;;
esac
mkdir -p $SETUPDIR
curl -fsSL https://raw.githubusercontent.com/StreamOfRon/setup/main/run-ansible-pull.sh | zsh