Advertisement
sergio_educacionit

updater.sh

Dec 30th, 2023
1,018
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.36 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4. # verficiar si el usuario es root.
  5.  
  6. # La variable de entorno '$UID' contiene la id de
  7. # usuario conectado o que tiene sesion abierta en un shell
  8.  
  9. # Si condicion     Entonces...
  10. if [ $UID -eq 0 ]; then
  11.  
  12.     # esto
  13.     apt update
  14.     apt upgrade -y
  15. # Sino...
  16. else
  17.     # esto otro
  18.     echo "Debes ser usuario 'root' para ejecutar este programa."
  19.  
  20. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement