Updated to new add-usergroup method

This commit is contained in:
Brian Zalewski 2024-05-20 07:15:50 +00:00
parent 94ad04c7c6
commit 5bf5599fc6
5 changed files with 5 additions and 1 deletions

View file

@ -564,7 +564,7 @@ async function main() {
} else {
const groups = typeof x[groupsField] === 'string' ? [x[groupsField]] : x[groupsField]
return groups.flatMap(y => {
return $`sudo "${os.homedir()}/.local/bin/add-usergroup" "${process.env.USER}" "${y}"`
return $`sudo "${os.homedir()}/.local/bin/add-usergroup" "${y}" "${y}" && sudo "${os.homedir()}/.local/bin/add-usergroup" "${process.env.USER}" "${y}"`
})
}
})

View file

@ -26,6 +26,7 @@ ensureNetdataOwnership() {
if command -v netdata-claim.sh > /dev/null; then
### Add user / group with script in ~/.local/bin/add-usergroup, if it is available
if command -v add-usergroup > /dev/null; then
sudo add-usergroup netdata netdata
sudo add-usergroup "$USER" netdata
fi
### Ensure ownership

View file

@ -31,6 +31,7 @@ if command -v privoxy > /dev/null; then
logg info "Running sudo chmod 600 $PRIVOXY_CONFIG"
sudo chmod 600 "$PRIVOXY_CONFIG"
if command -v add-usergroup > /dev/null; then
sudo add-usergroup privoxy privoxy
sudo add-usergroup "$USER" privoxy
fi
logg info 'Applying proper permissions to Privoxy configuration'

View file

@ -79,6 +79,7 @@ EOT
sudo chmod 750 /var/cache/rclone
### Add user / group with script in ~/.local/bin/add-usergroup, if it is available
if command -v add-usergroup > /dev/null; then
sudo add-usergroup rclone rclone
sudo add-usergroup "$USER" rclone
fi
sudo chown -Rf rclone:rclone /var/cache/rclone

View file

@ -51,6 +51,7 @@
if command -v smbd > /dev/null; then
# Add user / group with script in ~/.local/bin/add-usergroup, if it is available
if command -v add-usergroup > /dev/null; then
sudo add-usergroup rclone rclone
sudo add-usergroup "$USER" rclone
fi
### Define share locations