From 41517e5de650b213881c711b0a48c9e2046ebc61 Mon Sep 17 00:00:00 2001 From: Scott Ames Date: Tue, 18 Jul 2023 16:21:48 -0700 Subject: [PATCH] fix(1Password): post script was missing a few things --- scripts/post/1Password.sh | 22 ++++++++++++++++++++-- scripts/pre/1Password.sh | 7 +++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 scripts/pre/1Password.sh diff --git a/scripts/post/1Password.sh b/scripts/post/1Password.sh index be77c23..9e3077c 100644 --- a/scripts/post/1Password.sh +++ b/scripts/post/1Password.sh @@ -3,7 +3,25 @@ set -oeux pipefail mv /var/opt/1Password \ - /usr/share/1Password + /usr/share/1Password sed -i 's|^Exec=/opt/1Password/1password %U|Exec=/usr/share/1Password/1password %U|' \ - /usr/share/applications/1password.desktop + /usr/share/applications/1password.desktop + +rm /usr/bin/1password +ln -s /usr/share/1Password/1password /usr/bin/1password + +# CLI +#https://cache.agilebits.com/dist/1P/op2/pkg/v2.19.0/op_linux_amd64_v2.19.0.zip +echo "Installing 1Password" + +cd "$(mktemp -d)" + +if [ ! "$(getent group onepassword-cli)" ]; then + groupadd onepassword-cli +fi + +chgrp onepassword-cli /usr/bin/op +chmod g+s /usr/bin/op + +op --version diff --git a/scripts/pre/1Password.sh b/scripts/pre/1Password.sh new file mode 100644 index 0000000..275c6be --- /dev/null +++ b/scripts/pre/1Password.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -oeux pipefail + +if [ ! "$(getent group onepassword-cli)" ]; then + groupadd -g 1010 onepassword-cli +fi