Advertisement
NilsRapilly

Untitled

Feb 6th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.41 KB | None | 0 0
  1. ##############HOW TO USE ##############
  2. # to make this program executable : chmod +x install.sh
  3. # to run  this program type       : ./install.sh
  4.  
  5.  
  6. ############# functions core #########
  7.  
  8. parse_id(){
  9. clear
  10.     current_id=$( id | grep "uid=0(root)" )
  11.     echo $current_id
  12. }
  13.  
  14. check_id(){
  15. clear
  16.     if [ -z $1 ]
  17.     then
  18.         echo "veuillez passer en utilisateur root pour poursuivre"
  19.     else
  20.         echo "session root valide, installation des packets"
  21.         install_programs
  22.         poweruser_disable
  23.         poweruser_clean
  24. fi
  25. }
  26.  
  27. ####internal funcs____________________________________
  28.  
  29. install_programs(){
  30.     #___must install zone(!!!please do not touch!!!)
  31.      apt-get update && apt-get upgrade -y
  32.      apt-get install vim -y
  33.     #___free install zone(specify your packets here) __
  34.     #apt-get install ... -y
  35.     #__end of install zone_____________________________
  36.     echo "tous les packages sont installés et à jour"
  37. }
  38.  
  39. poweruser_disable(){
  40. clear
  41.     echo  "Voulez vous désactiver sudo pour user ?}[Y/N] "
  42.     read anws
  43.     if [[ "$anws" == "Y" ]]||[[ "$anws" == "y" ]]; then
  44.         echo "desactivation de sudo veuillez saisir votre futur mot de pass root"
  45.             passwd
  46.            
  47.              poweruser_clean
  48.     else
  49.         echo "sudo restera activé sur cette machine"
  50. fi
  51. }
  52. poweruser_clean(){
  53.     apt-get --purge autoremove sudo
  54. }
  55.  
  56. ############# functions misc ##d########
  57.  
  58. ############# main #####################
  59. __main__()
  60. {
  61. id=$(parse_id)
  62. check_id $id
  63. }
  64.  
  65. __main__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement