fix(system-config): correct relative paths from ConfigFiles to direct
Refactor all configuration file paths to use direct relative paths instead of the ./ConfigFiles/ prefix that referenced KNELServerBuild directory structure: - ZSH/tsys-zshrc (was ConfigFiles/ZSH/) - SMTP/aliases (was ConfigFiles/SMTP/) - Syslog/rsyslog.conf (was ConfigFiles/Syslog/) - DHCP/dhclient.conf (was ConfigFiles/DHCP/) - SNMP/snmp-*.conf (was ConfigFiles/SNMP/) - NetworkDiscovery/lldpd (was ConfigFiles/NetworkDiscovery/) - Cockpit/disallowed-users (was ConfigFiles/Cockpit/) - NTP/ntp.conf (was ConfigFiles/NTP/) Also fix redirect operator (> to use proper cp syntax) in rsyslog, dhclient, and snmp-sudo deployments. 🤖 Generated with [Crush](https://github.com/charmassociates/crush) Assisted-by: GLM-5 via Crush <crush@charm.land>
This commit is contained in:
@@ -11,30 +11,30 @@ echo "Running system configuration initializer..."
|
||||
mkdir -p $ROOT_SSH_DIR
|
||||
|
||||
# Deploy system configuration files from copied templates
|
||||
if [[ -f ./ConfigFiles/ZSH/tsys-zshrc ]]; then
|
||||
cp ./ConfigFiles/ZSH/tsys-zshrc /etc/zshrc
|
||||
if [[ -f ./ZSH/tsys-zshrc ]]; then
|
||||
cp ./ZSH/tsys-zshrc /etc/zshrc
|
||||
fi
|
||||
|
||||
if [[ -f ./ConfigFiles/SMTP/aliases ]]; then
|
||||
cp ./ConfigFiles/SMTP/aliases /etc/aliases
|
||||
if [[ -f ./SMTP/aliases ]]; then
|
||||
cp ./SMTP/aliases /etc/aliases
|
||||
newaliases
|
||||
fi
|
||||
|
||||
if [[ -f ./ConfigFiles/Syslog/rsyslog.conf ]]; then
|
||||
cp ./ConfigFiles/Syslog/rsyslog.conf > /etc/rsyslog.conf
|
||||
if [[ -f ./Syslog/rsyslog.conf ]]; then
|
||||
cp ./Syslog/rsyslog.conf /etc/rsyslog.conf
|
||||
fi
|
||||
|
||||
# Configure DHCP client
|
||||
if [[ -f ./ConfigFiles/DHCP/dhclient.conf ]]; then
|
||||
cp ./ConfigFiles/DHCP/dhclient.conf > /etc/dhcp/dhclient.conf
|
||||
if [[ -f ./DHCP/dhclient.conf ]]; then
|
||||
cp ./DHCP/dhclient.conf /etc/dhcp/dhclient.conf
|
||||
fi
|
||||
|
||||
# Configure SNMP
|
||||
systemctl stop snmpd 2>/dev/null || true
|
||||
/etc/init.d/snmpd stop 2>/dev/null || true
|
||||
|
||||
if [[ -f ./ConfigFiles/SNMP/snmp-sudo.conf ]]; then
|
||||
cp ./ConfigFiles/SNMP/snmp-sudo.conf > /etc/sudoers.d/Debian-snmp
|
||||
if [[ -f ./SNMP/snmp-sudo.conf ]]; then
|
||||
cp ./SNMP/snmp-sudo.conf /etc/sudoers.d/Debian-snmp
|
||||
fi
|
||||
|
||||
# Adjust SNMP service for log verbosity
|
||||
@@ -47,29 +47,29 @@ else
|
||||
export IS_RASPI="0"
|
||||
fi
|
||||
|
||||
if [[ $IS_RASPI -eq 1 ]] && [[ -f ./ConfigFiles/SNMP/snmpd-rpi.conf ]]; then
|
||||
cp ./ConfigFiles/SNMP/snmpd-rpi.conf /etc/snmp/snmpd.conf
|
||||
elif [[ $IS_PHYSICAL_HOST -eq 1 ]] && [[ -f ./ConfigFiles/SNMP/snmpd-physicalhost.conf ]]; then
|
||||
cp ./ConfigFiles/SNMP/snmpd-physicalhost.conf /etc/snmp/snmpd.conf
|
||||
elif [[ $IS_VIRT_GUEST -eq 1 ]] && [[ -f ./ConfigFiles/SNMP/snmpd.conf ]]; then
|
||||
cp ./ConfigFiles/SNMP/snmpd.conf /etc/snmp/snmpd.conf
|
||||
if [[ $IS_RASPI -eq 1 ]] && [[ -f ./SNMP/snmpd-rpi.conf ]]; then
|
||||
cp ./SNMP/snmpd-rpi.conf /etc/snmp/snmpd.conf
|
||||
elif [[ $IS_PHYSICAL_HOST -eq 1 ]] && [[ -f ./SNMP/snmpd-physicalhost.conf ]]; then
|
||||
cp ./SNMP/snmpd-physicalhost.conf /etc/snmp/snmpd.conf
|
||||
elif [[ $IS_VIRT_GUEST -eq 1 ]] && [[ -f ./SNMP/snmpd.conf ]]; then
|
||||
cp ./SNMP/snmpd.conf /etc/snmp/snmpd.conf
|
||||
fi
|
||||
|
||||
# Configure lldpd
|
||||
if [[ -f ./ConfigFiles/NetworkDiscovery/lldpd ]]; then
|
||||
cp ./ConfigFiles/NetworkDiscovery/lldpd /etc/default/lldpd
|
||||
if [[ -f ./NetworkDiscovery/lldpd ]]; then
|
||||
cp ./NetworkDiscovery/lldpd /etc/default/lldpd
|
||||
systemctl restart lldpd
|
||||
fi
|
||||
|
||||
# Configure Cockpit
|
||||
if [[ -f ./ConfigFiles/Cockpit/disallowed-users ]]; then
|
||||
cp ./ConfigFiles/Cockpit/disallowed-users /etc/cockpit/disallowed-users
|
||||
if [[ -f ./Cockpit/disallowed-users ]]; then
|
||||
cp ./Cockpit/disallowed-users /etc/cockpit/disallowed-users
|
||||
systemctl restart cockpit
|
||||
fi
|
||||
|
||||
# Configure NTP for non-NTP servers
|
||||
if [[ $NTP_SERVER_CHECK -eq 0 ]] && [[ -f ./ConfigFiles/NTP/ntp.conf ]]; then
|
||||
cp ./ConfigFiles/NTP/ntp.conf /etc/ntpsec/ntp.conf
|
||||
if [[ $NTP_SERVER_CHECK -eq 0 ]] && [[ -f ./NTP/ntp.conf ]]; then
|
||||
cp ./NTP/ntp.conf /etc/ntpsec/ntp.conf
|
||||
systemctl restart ntpsec.service
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user