Created
December 3, 2023 00:03
-
-
Save b-/ed2cdc182ae5a92bdcd6b73308832a70 to your computer and use it in GitHub Desktop.
fix onepassword gid for ublue-os custom image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# fixes 1Password GID problems on ublue-os custom images | |
set -euxo pipefail | |
OPCLI_CONF=$(</usr/lib/sysusers.d/onepassword-cli.conf) | |
TARGET_OPCLI_GID="${OPCLI_CONF##g onepassword-cli }" | |
CURRENT_OPCLI_GID=$(getent group onepassword-cli | cut -d: -f3) | |
OP_CONF=$(</usr/lib/sysusers.d/onepassword.conf) | |
CURRENT_OP_GID=$(getent group onepassword | cut -d: -f3) | |
TARGET_OP_GID="${OP_CONF##g onepassword }" | |
if [ "${CURRENT_OP_GID}" -ne "${TARGET_OP_GID}" ] ; then | |
sudo groupmod -g "${TARGET_OP_GID}" onepassword && echo "New onepassword GID: ${TARGET_OP_GID}" | |
fi | |
if [ "${CURRENT_OPCLI_GID}" -ne "${TARGET_OPCLI_GID}" ] ; then | |
sudo groupmod -g "${TARGET_OPCLI_GID}" onepassword-cli && echo "New onepassword GID: ${TARGET_OP_GID}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment