title: How to detect whether apt-get requires a reboot using Bash?
body: <p>I am writing a bash script (for apt-get based OS's) that automates the installations process of various programs. In this process I run "apt-get -fy update" and "apt-get -fy upgrade" sometimes. In the process of upgrading, occasionally, a restart is required. </p>
  
  <p>My question: is there a way of testing if the system is asking for a restart after running "apt-get -fy upgrade"? I am trying to write the script for it to run from beginning to end without human any intervention.</p>
  
  <p>Thank you.</p>