Pi Enthusiast
Posts: 2
Joined: Wed Mar 14, 2018 8:00 pm

Adding Y/N Component to Update Shell Script

Sat Mar 17, 2018 1:38 pm

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

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Adding Y/N Component to Update Shell Script

Sat Mar 17, 2018 2:30 pm

Look at /usr/bin/raspi-config that uses whiptail for Y/N questions.

Yes, it is a bash script.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Other projects”