forked from holman/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.install-password-manager.sh
executable file
·40 lines (31 loc) · 1.22 KB
/
.install-password-manager.sh
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
#!/bin/sh
if [ -n "${CODESPACES}" ]; then
log "Exit. Skip install-password-manager for codespaces."
exit
fi
# exit immediately if password-manager-binary is already in $PATH
type op >/dev/null 2>&1 && exit
case "$(uname -s)" in
Darwin)
brew install 1password-cli
;;
Linux)
# TODO: Untested
sudo -s \
curl -sS https://downloads.1password.com/linux/keys/1password.asc | \
gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/$(dpkg --print-architecture) stable main" |
tee /etc/apt/sources.list.d/1password.list
mkdir -p /etc/debsig/policies/AC2D62742012EA22/
curl -sS https://downloads.1password.com/linux/debian/debsig/1password.pol | \
tee /etc/debsig/policies/AC2D62742012EA22/1password.pol
mkdir -p /usr/share/debsig/keyrings/AC2D62742012EA22
curl -sS https://downloads.1password.com/linux/keys/1password.asc | \
gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg
apt update && apt install 1password-cli
;;
*)
echo "unsupported OS"
exit 1
;;
esac