mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Add omarchy-doctor
This commit is contained in:
@@ -1,16 +1,32 @@
|
||||
chrootable_systemctl_enable cups.service
|
||||
OMARCHY_DESCRIPTION="Printer Config"
|
||||
|
||||
# Disable multicast dns in resolved. Avahi will provide this for better network printer discovery
|
||||
sudo mkdir -p /etc/systemd/resolved.conf.d
|
||||
echo -e "[Resolve]\nMulticastDNS=no" | sudo tee /etc/systemd/resolved.conf.d/10-disable-multicast.conf
|
||||
chrootable_systemctl_enable avahi-daemon.service
|
||||
omarchy_install() {
|
||||
chrootable_systemctl_enable cups.service
|
||||
|
||||
# Enable mDNS resolution for .local domains
|
||||
sudo sed -i 's/^hosts:.*/hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns/' /etc/nsswitch.conf
|
||||
# Disable multicast dns in resolved. Avahi will provide this for better network printer discovery
|
||||
sudo mkdir -p /etc/systemd/resolved.conf.d
|
||||
echo -e "[Resolve]\nMulticastDNS=no" | sudo tee /etc/systemd/resolved.conf.d/10-disable-multicast.conf
|
||||
chrootable_systemctl_enable avahi-daemon.service
|
||||
|
||||
# Enable automatically adding remote printers
|
||||
if ! grep -q '^CreateRemotePrinters Yes' /etc/cups/cups-browsed.conf; then
|
||||
echo 'CreateRemotePrinters Yes' | sudo tee -a /etc/cups/cups-browsed.conf
|
||||
fi
|
||||
# Enable mDNS resolution for .local domains
|
||||
sudo sed -i 's/^hosts:.*/hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns/' /etc/nsswitch.conf
|
||||
|
||||
chrootable_systemctl_enable cups-browsed.service
|
||||
# Enable automatically adding remote printers
|
||||
if ! grep -q '^CreateRemotePrinters Yes' /etc/cups/cups-browsed.conf; then
|
||||
echo 'CreateRemotePrinters Yes' | sudo tee -a /etc/cups/cups-browsed.conf
|
||||
fi
|
||||
|
||||
chrootable_systemctl_enable cups-browsed.service
|
||||
}
|
||||
|
||||
omarchy_verify() {
|
||||
systemctl is-enabled cups.service >/dev/null 2>&1 || add_error "CUPS service not enabled"
|
||||
systemctl is-enabled avahi-daemon.service >/dev/null 2>&1 || add_error "Avahi daemon not enabled"
|
||||
systemctl is-enabled cups-browsed.service >/dev/null 2>&1 || add_error "CUPS browsed service not enabled"
|
||||
|
||||
[[ -f /etc/systemd/resolved.conf.d/10-disable-multicast.conf ]] || add_error "Multicast DNS config missing"
|
||||
|
||||
grep -q "mdns_minimal" /etc/nsswitch.conf || add_error "mDNS not configured in nsswitch.conf"
|
||||
|
||||
[[ -f /etc/cups/cups-browsed.conf ]] && grep -q '^CreateRemotePrinters Yes' /etc/cups/cups-browsed.conf || add_error "Remote printers not enabled in CUPS"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user