31 lines
1.1 KiB
Bash
31 lines
1.1 KiB
Bash
#!/bin/sh
|
|
|
|
# Enable SSH keepalive
|
|
sed -i -e 's/^[\s#]*TCPKeepAlive\s.*/TCPKeepAlive yes/' -e 's/^[\s#]*ClientAliveInterval\s.*/ClientAliveInterval 60/' /etc/ssh/sshd_config
|
|
echo 'enabled SSH keep alives'
|
|
|
|
# openRC
|
|
sed -i -e 's/^[\s#]*rc_cgroup_mode=.*/rc_cgroup_mode="unified"/' /etc/rc.conf
|
|
sed -i -e 's/^[\s#]*rc_logger=.*/rc_logger="YES"/' /etc/rc.conf
|
|
echo 'enabled cgroupv2, openRC logging'
|
|
|
|
# OpenRC parallel - causes too much chaos
|
|
#sed -i -e 's/^[\s#]*rc_parallel=.*/rc_parallel="YES"/' /etc/rc.conf
|
|
#echo 'enable parallel openRC'
|
|
|
|
# Setup syslog-ng json logging and apparmor tweaks
|
|
cp /lib/zdt/syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
|
|
cp /lib/zdt/syslog-ng.logrotate.conf /etc/logrotate.d/syslog-ng
|
|
cp /lib/zdt/syslog-ng.apparmor /etc/apparmor.d/local/sbin.syslog-ng
|
|
|
|
mv /etc/periodic/daily/logrotate /etc/periodic/hourly/
|
|
echo 'syslog-ng: all to /var/log/messages as json, rotate hourly'
|
|
|
|
# use init to spawn monit
|
|
echo ":2345:respawn:/usr/bin/monit -Ic /etc/monitrc.zdt" >> /etc/inittab
|
|
echo 'Enable monit via inittab'
|
|
|
|
# QoL
|
|
mv /etc/profile.d/color_prompt.sh.disabled /etc/profile.d/color_prompt.sh || true
|
|
echo 'alias rs="doas bash"' > /etc/profile.d/alias.sh
|