-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.install-password-manager.sh
More file actions
executable file
·43 lines (39 loc) · 1.18 KB
/
Copy path.install-password-manager.sh
File metadata and controls
executable file
·43 lines (39 loc) · 1.18 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
#!/bin/sh
if [ -n "$CHEZMOI_VERBOSE" ]; then
echo 'Checking for Bitwarden.'
fi
if ! type bw >/dev/null 2>&1; then
echo 'Installing Bitwarden.'
case "$(uname -s)" in
Darwin)
brew install --quiet bitwarden-cli
;;
Linux)
if [ -f /etc/arch-release ]; then
sudo pacman -S bitwarden-cli
elif [ -f /etc/debian_version ]; then
sudo apt-get install bitwarden-cli
elif [ -f /etc/redhat-release ]; then
yum install bitwarden-cli
elif [ -f /etc/gentoo-release ]; then
emerge install bitwarden-cli
elif [ -f /etc/SuSE-release ]; then
zypp install bitwarden-cli
elif [ -f /etc/alpine-release ]; then
apk install bitwarden-cli
else
echo >&2 'Could not identify package manager.'
fi
;;
*)
echo >&2 'Could not identify operating system.'
;;
esac
fi
if ! type bw >/dev/null 2>&1; then
printf "%s\n" "$(tput setaf 3)Proceeding without Bitwarden.$(tput sgr0)"
printf "%s\n" "$(tput setaf 8)You will need to manually supply data that would be pulled from Bitwarden, but everything should work fine.$(tput sgr0)"
fi
if [ -n "$CHEZMOI_VERBOSE" ]; then
echo 'Done.'
fi