Page 1 of 1

Adding Y/N Component to Update Shell Script

Posted: Sat Mar 17, 2018 1:38 pm
by Pi Enthusiast
Good Afternoon.
I am here because I need some help modifying a update shell script I created.
A little while ago, I created a shell script that I can boot from the pixel desktop allowing me to update without putting sudo apt-get update/upgrade etc.
However, I decided earlier on today to add a part to the code that gives me a choice to ether reboot or exit the terminal.
There is just one problem.
I know barely anything about programming shell scripts.
So I am hoping that somebody here will please help me out with this issue.
Thanks very much.
PI Enthusiast

Ps. Here is the code for anybody who wants to help as a point of reference.

Code: Select all

#!/bin/bash
sudo apt-get update && sudo apt-get upgrade

Re: Adding Y/N Component to Update Shell Script

Posted: Sat Mar 17, 2018 2:30 pm
by DougieLawson
Look at /usr/bin/raspi-config that uses whiptail for Y/N questions.

Yes, it is a bash script.