diff options
author | Robert Peichaer <rpe@cvs.openbsd.org> | 2017-02-14 22:23:05 +0000 |
---|---|---|
committer | Robert Peichaer <rpe@cvs.openbsd.org> | 2017-02-14 22:23:05 +0000 |
commit | df510596c9e4d14cafde3ebaebd45153e0be0b68 (patch) | |
tree | df103c9a547b852285f28933491c482ad77e88d9 /distrib | |
parent | 11a473ec05b1e11bc00a43ab8ae16446407ba3f6 (diff) |
These variables are global so use uppercase and rename sshd and xdm
to START_SSHD and START_XDM to better match their purpose.
aperture -> APERTURE
defcons -> DEFCONS
ssh_enableroot -> SSHD_ENABLEROOT
sshd -> START_SSHD
xdm -> START_XDM
OK krw@, tb@
Diffstat (limited to 'distrib')
-rw-r--r-- | distrib/miniroot/install.sub | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 1ed93ddd0fe..5c269b1ba77 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.972 2017/02/14 22:05:13 rpe Exp $ +# $OpenBSD: install.sub,v 1.973 2017/02/14 22:23:04 rpe Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org> @@ -1874,19 +1874,19 @@ questions() { local _d _cdef=no ask_yn "Start sshd(8) by default?" yes - sshd=$resp + START_SSHD=$resp - aperture= + APERTURE= resp= - xdm= + START_XDM= if [[ -n $DISPLAY ]]; then if [[ -n $(scan_dmesg '/^[a-z]*[01]: aperture needed/p') ]]; then ask_yn "Do you expect to run the X Window System?" yes && - aperture=$MDXAPERTURE + APERTURE=$MDXAPERTURE fi if [[ -n $MDXDM && $resp != n ]]; then ask_yn "Do you want the X Window System to be started by xdm(1)?" - xdm=$resp + START_XDM=$resp fi fi @@ -1894,12 +1894,12 @@ questions() { _d=${CPROM:-$CDEV} [[ -n $CONSOLE ]] && _cdef=yes ask_yn "Change the default console to $_d?" $_cdef - defcons=$resp + DEFCONS=$resp if [[ $resp == y ]]; then ask_which "speed" "should $_d use" \ "9600 19200 38400 57600 115200" $CSPEED case $resp in - done) defcons=n;; + done) DEFCONS=n;; *) CSPEED=$resp;; esac fi @@ -1955,7 +1955,7 @@ user_setup() { ask_root_sshd() { typeset -l _resp - [[ $sshd == y ]] || return + [[ $START_SSHD == y ]] || return if [[ -z $ADMIN ]]; then echo "Since no user was setup, root logins via sshd(8) might be useful." @@ -1965,12 +1965,12 @@ ask_root_sshd() { ask "Allow root ssh login? (yes, no, prohibit-password)" no _resp=$resp case $_resp in - y|yes) sshd_enableroot=yes + y|yes) SSHD_ENABLEROOT=yes ;; - n|no) sshd_enableroot=no + n|no) SSHD_ENABLEROOT=no ;; w|p|without-password|prohibit-password) - sshd_enableroot=prohibit-password + SSHD_ENABLEROOT=prohibit-password ;; *) echo "'$resp' is not a valid choice." $AUTO && exit 1 @@ -2455,25 +2455,25 @@ install_sets() { # Apply configuration settings based on the previously gathered information. apply() { - if [[ $sshd == n ]]; then + if [[ $START_SSHD == n ]]; then echo "sshd_flags=NO" >>/mnt/etc/rc.conf.local - elif [[ -n $sshd_enableroot ]]; then + elif [[ -n $SSHD_ENABLEROOT ]]; then # Only change sshd_config if the user choice is not the default. - if ! grep -q "^#PermitRootLogin $sshd_enableroot\$" \ + if ! grep -q "^#PermitRootLogin $SSHD_ENABLEROOT\$" \ /mnt/etc/ssh/sshd_config; then - sed -i "s/^#\(PermitRootLogin\) .*/\1 $sshd_enableroot/" \ + sed -i "s/^#\(PermitRootLogin\) .*/\1 $SSHD_ENABLEROOT/" \ /mnt/etc/ssh/sshd_config fi fi - [[ -n $aperture ]] && - echo "machdep.allowaperture=$aperture # See xf86(4)" \ + [[ -n $APERTURE ]] && + echo "machdep.allowaperture=$APERTURE # See xf86(4)" \ >>/mnt/etc/sysctl.conf - [[ $xdm == y && -x /mnt/usr/X11R6/bin/xdm ]] && + [[ $START_XDM == y && -x /mnt/usr/X11R6/bin/xdm ]] && echo "xdm_flags=" >>/mnt/etc/rc.conf.local - if [[ $defcons == y ]]; then + if [[ $DEFCONS == y ]]; then cp /mnt/etc/ttys /tmp/i/ttys sed -e "/^$CTTY/s/std.9600/std.${CSPEED}/" \ -e "/^$CTTY/s/unknown/vt220 /" \ |