Dialog using xmessage

Tag(s):

#!/bin/sh
 
answer=$(xmessage  "Are you sure you want to reboot?" -buttons yes,no -print)
if [ "$answer" == "yes" ];then
   systemctl reboot
fi

Credit: https://github.com/joewing/jwm/issues/362