-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall
executable file
·45 lines (42 loc) · 1007 Bytes
/
install
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
#!/usr/bin/env sh
help() {
echo "Usage: ./install [-p arg] [-w arg] [-d arg] [-g arg]"
echo "-p (the password for the private mail account)"
echo "-d (the password for the cal- and carddav account)"
echo "-g (the password for the github account)"
echo "-h (print this message)"
}
while getopts ':p:w:d:g:h' opt; do
case $opt in
p)
private_pw=$OPTARG
;;
d)
dav_pw=$OPTARG
;;
g)
github_pw=$OPTARG
;;
h)
help
exit
;;
?)
echo "Invalid Parameter given. $(help)"
;;
esac
done
os="$(uname)"
if [ "$os" = "Darwin" ]; then
ansible-playbook --ask-become-pass \
-i hosts \
mac.yml
elif [ "$os" = "Linux" ]; then
DAV_PW=$dav_pw \
MAIL_PRIVATE_PW=$private_pw \
GITHUB_PW=$github_pw \
ansible-playbook --ask-become-pass -i hosts linux.yml
else
echo "Unknow OS: $os"
exit 1
fi