49 lines
886 B
Plaintext
Executable File
49 lines
886 B
Plaintext
Executable File
# 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
|
|
}
|
|
|
|
setup_browser_helper() {
|
|
# Setup the Core App Integration helper binary with the correct permissions and group
|
|
BROWSER_SUPPORT_PATH="/opt/1Password/1Password-BrowserSupport"
|
|
|
|
chgrp "${GROUP_NAME}" $BROWSER_SUPPORT_PATH
|
|
chmod g+s $BROWSER_SUPPORT_PATH
|
|
}
|
|
|
|
pre_install() {
|
|
if app_group_exists; then
|
|
: # Do nothing
|
|
else
|
|
groupadd "${GROUP_NAME}"
|
|
fi
|
|
}
|
|
|
|
pre_upgrade() {
|
|
if app_group_exists; then
|
|
: # Do nothing
|
|
else
|
|
groupadd "${GROUP_NAME}"
|
|
fi
|
|
}
|
|
|
|
post_install() {
|
|
setup_browser_helper
|
|
}
|
|
|
|
post_upgrade() {
|
|
setup_browser_helper
|
|
}
|
|
|
|
post_remove() {
|
|
if app_group_exists; then
|
|
groupdel "${GROUP_NAME}"
|
|
fi
|
|
}
|