Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##############HOW TO USE ##############
- # to make this program executable : chmod +x install.sh
- # to run this program type : ./install.sh
- ############# functions core #########
- parse_id(){
- clear
- current_id=$( id | grep "uid=0(root)" )
- echo $current_id
- }
- check_id(){
- clear
- if [ -z $1 ]
- then
- echo "veuillez passer en utilisateur root pour poursuivre"
- else
- echo "session root valide, installation des packets"
- install_programs
- poweruser_disable
- poweruser_clean
- fi
- }
- ####internal funcs____________________________________
- install_programs(){
- #___must install zone(!!!please do not touch!!!)
- apt-get update && apt-get upgrade -y
- apt-get install vim -y
- #___free install zone(specify your packets here) __
- #apt-get install ... -y
- #__end of install zone_____________________________
- echo "tous les packages sont installés et à jour"
- }
- poweruser_disable(){
- clear
- echo "Voulez vous désactiver sudo pour user ?}[Y/N] "
- read anws
- if [[ "$anws" == "Y" ]]||[[ "$anws" == "y" ]]; then
- echo "desactivation de sudo veuillez saisir votre futur mot de pass root"
- passwd
- poweruser_clean
- else
- echo "sudo restera activé sur cette machine"
- fi
- }
- poweruser_clean(){
- apt-get --purge autoremove sudo
- }
- ############# functions misc ##d########
- ############# main #####################
- __main__()
- {
- id=$(parse_id)
- check_id $id
- }
- __main__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement