Fix user creation

pull/1/head
Nicolas Arenas 2024-11-11 11:47:41 +01:00
parent dffe6c1744
commit 094ce0ecc1
1 changed files with 10 additions and 2 deletions

View File

@ -34,8 +34,15 @@ install_updcast () {
}
add_user_ogrepository() {
useradd -r -s /bin/bash ogrepository
echo 'ogrepository ALL=(ALL) NOPASSWD: ALL' > ogrepository
if ! id "ogrepository" &>/dev/null; then
echo "User ogrepository does not exist, creating it"
useradd -r -s /bin/bash ogrepository
fi
if [ ! -f /etc/sudoers.d/ogrepository ]; then
echo "User ogrepository does not have sudo permissions, adding it"
echo 'ogrepository ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/ogrepository
fi
}
create_directories() {
@ -72,6 +79,7 @@ install_files() {
## Main program
check_root
install_ext_repo
install_dependencies
install_external_packages
install_uftp