#!/bin/sh # vim: set sw=4 ts=4 sts=4 et : . /lib/gentoo/functions.sh confirm() { unset _confirm printf '%s [y/N] ' "${1-Do you want to continue?}" read _confirm case "${_confirm}" in [Yy]|[Yy][Ee][Ss]) return 0 ;; *) return 1 ;; esac } printf "${WARN}" printf 'This operation will COMPLETELY ERASE all data and information ' printf 'stored on this system!\n' printf "${NORMAL}" confirm || exit 9 ewarn 'The system will now reboot and wipe all data.' systemctl enable --runtime factory-reset.service systemctl reboot