diff options
Diffstat (limited to '1password.install')
-rw-r--r-- | 1password.install | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/1password.install b/1password.install new file mode 100644 index 000000000000..43e7894772af --- /dev/null +++ b/1password.install @@ -0,0 +1,34 @@ +# Do not add your user, or any others, to this group. +GROUP_NAME="onepassword" + +app_group_exists() { + if [ $(getent group "${GROUP_NAME}") ]; then + true + else + false + fi +} + +pre_install() { + if app_group_exists; then + // Do nothing + else + groupadd "${GROUP_NAME}" + fi +} + +post_install() { + # Setup the Core App Integration helper binary with the correct permissions and group + HELPER_PATH="/opt/1password/1Password-KeyringHelper" + + chgrp "${GROUP_NAME}" $HELPER_PATH + # The binary requires setuid so it may interact with the Kernel keyring facilities + chmod u+s $HELPER_PATH + chmod g+s $HELPER_PATH +} + +post_remove() { + if app_group_exists; then + groupdel "${GROUP_NAME}" + fi +} |