| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #!/usr/bin/env bash
- # NAME: Enable and configure system services
- set -euo pipefail
- echo "Enabling and configuring system services..."
- # ═══════════════════════════════════════════════════════════
- # 🌐 NETWORKING SERVICES
- # ═══════════════════════════════════════════════════════════
- echo "Enabling networking services..."
- # NetworkManager (main network management)
- sudo systemctl enable --now NetworkManager.service
- # Bluetooth
- sudo systemctl enable --now bluetooth.service
- # SSH daemon
- sudo systemctl enable --now sshd.service
- # ═══════════════════════════════════════════════════════════
- # 🔊 AUDIO SERVICES
- # ═══════════════════════════════════════════════════════════
- echo "Enabling audio services..."
- # PipeWire audio (replaces PulseAudio)
- systemctl --user enable --now pipewire.service
- systemctl --user enable --now pipewire-pulse.service
- systemctl --user enable --now wireplumber.service
- # ═══════════════════════════════════════════════════════════
- # 🖨️ PRINTING SERVICES
- # ═══════════════════════════════════════════════════════════
- echo "Enabling printing services..."
- # CUPS printing system
- sudo systemctl enable --now cups.service
- # ═══════════════════════════════════════════════════════════
- # ⏰ TIME & SCHEDULING SERVICES
- # ═══════════════════════════════════════════════════════════
- echo "Configuring time and scheduling services..."
- echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
- sudo locale-gen
- # Set system locale
- echo "LANG=en_US.UTF-8" | sudo tee /etc/locale.conf
- echo "→ System locale set to en_US.UTF-8"
- sudo timedatectl set-timezone America/Montevideo
- # Enable NTP time synchronization
- sudo timedatectl set-ntp true
- sudo systemctl enable --now systemd-timesyncd.service
- # Cron daemon for scheduled tasks
- sudo systemctl enable --now cronie.service
- # ═══════════════════════════════════════════════════════════
- # 🔒 SECURITY & FIREWALL SERVICES
- # ═══════════════════════════════════════════════════════════
- echo "Enabling security services..."
- # UFW firewall
- sudo systemctl enable --now ufw.service
- # Enable basic firewall rules
- sudo ufw --force enable
- sudo ufw default deny incoming
- sudo ufw default allow outgoing
- # ═══════════════════════════════════════════════════════════
- # 💾 BACKUP & SYNC SERVICES
- # ═══════════════════════════════════════════════════════════
- echo "Enabling backup services..."
- # Snapper for BTRFS snapshots (if using BTRFS)
- if findmnt / -t btrfs &>/dev/null; then
- sudo systemctl enable --now snapper-timeline.timer
- sudo systemctl enable --now snapper-cleanup.timer
- echo "→ Snapper enabled (BTRFS detected)"
- else
- echo "→ Skipping Snapper (no BTRFS detected)"
- fi
- # ═══════════════════════════════════════════════════════════
- # ⚡ POWER MANAGEMENT
- # ═══════════════════════════════════════════════════════════
- echo "Enabling power management..."
- # Power profiles daemon
- sudo systemctl enable --now power-profiles-daemon.service
- # ═══════════════════════════════════════════════════════════
- # 🔧 SYSTEM OPTIMIZATION
- # ═══════════════════════════════════════════════════════════
- echo "Enabling system optimization..."
- # Haveged entropy daemon
- sudo systemctl enable --now haveged.service
- # Locate database updates
- sudo systemctl enable --now plocate-updatedb.timer
|