Skip to content

Instantly share code, notes, and snippets.

@jaapmarcus
Last active June 18, 2021 07:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaapmarcus/aea226b3a9bddfaea76b2e4fea3db7c6 to your computer and use it in GitHub Desktop.
Save jaapmarcus/aea226b3a9bddfaea76b2e4fea3db7c6 to your computer and use it in GitHub Desktop.
Rename user package on bulk
#!/bin/bash
old_name="default"
new_name="new_package"
# Update package for existing users
for user in `ls /usr/local/hestia/data/users/`; do
OLD_PACKAGE=$(/usr/local/hestia/bin/v-get-user-value $user PACKAGE)
if [ "$old_name" = "$OLD_PACKAGE" ]; then
/usr/local/hestia/bin/v-change-user-package $user $new_name
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment