
I'd like to create a bash script that I launch as normal user, ask me root password and if it's correct execute: apt update && apt upgrade && apt autoremove.
I tried different ways but unsuccesfully!
Ex I tried:
$ gedit update.bash
- Code: Select all
#!bin/bash
sudo root
apt update && apt upgrade && apt autoremove
# chmod +x update.bash
or I also tried:
- Code: Select all
#!bin/bash
su - && update && apt upgrade && apt autoremove
exit
Please, any suggestion/help?
Thank you so much!!
