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
Some checks failed
Nix Format Check / check-format (push) Failing after 39s
This commit is contained in:
23
setup.sh
23
setup.sh
@@ -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
|
||||
|
Reference in New Issue
Block a user