#!/bin/sh
# Overall installation starts when the user submits the names and destination.
# These events report actual boot phase boundaries before that point.
case " $(cat /proc/cmdline) " in *" newworld.autoinstall=1 "*) ;; *) exit 0;; esac
case "$1" in
    medium) en="Locating the NewWorld USB"; he="מאתר את התקן ההתקנה של NewWorld" ;;
    mounted) en="Desktop filesystem mounted, starting installer"; he="מערכת הקבצים נטענה, מפעיל את תוכנית ההתקנה" ;;
    *) exit 0 ;;
esac
case " $(cat /proc/cmdline) " in
    *" locales=he_IL."*) text="$he · התקנה ⁦0%⁩ · זמן שנותר בחישוב" ;;
    *) text="$en | Installation 0% | ETA: estimating" ;;
esac
if [ -x /usr/bin/plymouth ] && /usr/bin/plymouth --ping 2>/dev/null; then
    /usr/bin/plymouth display-message --text="$text" 2>/dev/null && exit 0
fi
[ ! -c /dev/console ] || printf '%s\n' "$text" > /dev/console
exit 0
