Date: Tue, 26 Jul 2016 05:27:27 +0000 (UTC) From: Allan Jude <allanjude@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303332 - stable/11/usr.sbin/bsdinstall/scripts Message-ID: <201607260527.u6Q5RR1M086852@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: allanjude Date: Tue Jul 26 05:27:26 2016 New Revision: 303332 URL: https://svnweb.freebsd.org/changeset/base/303332 Log: MFC: r302790, r302795 Add new menu to bsdinstall to allow user to set date and time after selecting timezone. The 'skip' button is the default selection. Submitted by: des Approved by: re (gjb) Modified: stable/11/usr.sbin/bsdinstall/scripts/time Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/scripts/time ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/time Tue Jul 26 05:26:53 2016 (r303331) +++ stable/11/usr.sbin/bsdinstall/scripts/time Tue Jul 26 05:27:26 2016 (r303332) @@ -26,4 +26,42 @@ # # $FreeBSD$ +# Select timezone chroot $BSDINSTALL_CHROOT tzsetup + +# Switch to target timezone +saved_TZ="$TZ" +TZ="${BSDINSTALL_CHROOT}/etc/localtime" +export TZ + +# Set date +exec 3>&1 +DATE=$(dialog --backtitle 'FreeBSD Installer' \ + --title 'Time & Date' \ + --ok-label 'Set Date' \ + --cancel-label 'Skip' \ + --defaultno \ + --date-format '%Y%m%d%H%M.%S' \ + --calendar '' 2 40 \ +2>&1 1>&3) && date $DATE +exec 3>&- + +# Set time +exec 3>&1 +TIME=$(dialog --backtitle 'FreeBSD Installer' \ + --title 'Time & Date' \ + --ok-label 'Set Time' \ + --cancel-label 'Skip' \ + --defaultno \ + --time-format '%H%M.%S' \ + --timebox '' 2 40 \ +2>&1 1>&3) && date $TIME +exec 3>&- + +# Switch back +if [ -n "$saved_TZ" ]; then + TZ="$saved_TZ" +else + unset TZ +fi +unset saved_TZ
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607260527.u6Q5RR1M086852>