#!/bin/bash

msg="$(cat <<EOL
You are about to disable OEM configuration mode. The system will boot into the account setup wizard the next time it is started.

Are you sure you want to continue?
EOL
)";

if zenity --question --text="${msg}"; then
  lightdm_file="$(cat <<EOL
[SeatDefaults]
allow-guest=false
autologin-guest=false
autologin-user=oem
autologin-user-timeout=0
autologin-session=ubuntu-unity-oem-environment
EOL
)"
  echo "$lightdm_file" | sudo tee /etc/lightdm/lightdm.conf
  zenity --info --text='Done. The account setup wizard will run on next bootup.'
fi
