View Single Post
  #4   (View Single Post)  
Old 25th November 2022
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

Let's look at the 7.2 install script:
Code:
# Apply configuration settings based on the previously gathered information.
apply() {
    if [[ $START_SSHD == n ]]; then
        echo "sshd_flags=NO" >>/mnt/etc/rc.conf.local
    elif [[ -n $SSHD_ENABLEROOT ]]; then
        # Only change sshd_config if the user choice is not the default.
        if ! grep -q "^#PermitRootLogin $SSHD_ENABLEROOT\$" \
                /mnt/etc/ssh/sshd_config; then
            sed -i "s/^#\(PermitRootLogin\) .*/\1 $SSHD_ENABLEROOT/" \
                /mnt/etc/ssh/sshd_config
        fi
    fi

    [[ -n $APERTURE ]] &&
        echo "machdep.allowaperture=$APERTURE # See xf86(4)" \
            >>/mnt/etc/sysctl.conf

    [[ $START_XDM == y && -x /mnt/usr/X11R6/bin/xenodm ]] &&
        echo "xenodm_flags=" >>/mnt/etc/rc.conf.local

    if [[ $DEFCONS == y ]]; then
        cp /mnt/etc/ttys /tmp/i/ttys
        sed    -e "/^console/s/on  secure/off secure/" \
            -e "/^$CTTY/s/std.9600/std.${CSPEED}/" \
            -e "/^$CTTY/s/std.115200/std.${CSPEED}/" \
            -e "/^$CTTY/s/unknown/vt220    /" \
            -e "/$CTTY/s/off.*/on secure/" /tmp/i/ttys >/mnt/etc/ttys
        [[ -n $CPROM ]] &&
            echo "stty $CPROM $CSPEED\nset tty $CPROM" \
                >>/mnt/etc/boot.conf
    fi

    ln -sf /usr/share/zoneinfo/$TZ /mnt/etc/localtime
}
Reply With Quote