#!/bin/bash

# basic question
zenity --question --text="Restart in 2 minutes..?"

  if [ $? == 0 ]
   then
         shutdown -ry 2
   else
     exit
  fi

############################################
# COMMENT OUT TOP PART OR BOTTOM PART..!!
#         DON'T USE BOTH..!!
############################################


# or with progres bar...
(for i in $(seq 0 3 100); do echo "$i"; sleep 0.5; done) | zenity --progress --percentage=0 --auto-kill --text="Restart in 1 minute..?"

   if [ $? == 0 ]
    then
       shutdown -ry 1
    else
    exit
   fi