feat: add checks for community.general collection and ensure default shell is set to bash
Some checks failed
Nix Format Check / check-format (push) Failing after 39s

This commit is contained in:
2025-03-10 15:05:52 +01:00
parent 1aa25a743a
commit 0f0d67d419
7 changed files with 57 additions and 10 deletions

View File

@@ -338,6 +338,28 @@ check_compatibility() {
esac
}
# Ensure bash is set as the default shell for the user
ensure_shell() {
local shell
shell=$(getent passwd "$USER" | cut -d: -f7)
if [ "$shell" != "/bin/bash" ]; then
log_info "Setting default shell to bash..."
chsh -s /bin/bash || die "Failed to set default shell to bash"
log_success "Default shell set to bash."
fi
# Ensure shell is set for root user
if [ "$USER" != "root" ]; then
local root_shell
root_shell=$(getent passwd root | cut -d: -f7)
if [ "$root_shell" != "/bin/bash" ]; then
log_info "Setting default shell for root to bash..."
sudo chsh -s /bin/bash root || die "Failed to set default shell for root to bash"
log_success "Default shell for root set to bash."
fi
fi
}
main() {
check_compatibility
@@ -378,6 +400,7 @@ main() {
setup_symlinks
setup_ansible
ensure_shell
# Get hostname
local hostname