diff --git a/install/first_conf.sh b/install/first_conf.sh index 02191cf..9d72e00 100644 --- a/install/first_conf.sh +++ b/install/first_conf.sh @@ -1,20 +1,34 @@ #!/bin/bash + ## Config de Grub # Save old grub -cp /etc/default/grub /etc/default/grub.back -sed 's/GRUB_DEFAULT=0/GRUB_DEFAULT=4/g' /etc/default/grub > grub.n -mv grub.n /etc/default/grub +conf_grub (){ + GRUB_DEFAULT=1 + echo "----------- Move and config Grub ----" + cp /etc/default/grub /etc/default/grub.back + sed 's/GRUB_DEFAULT=0/GRUB_DEFAULT=$GRUB_DEFAULT/g' /etc/default/grub > grub.n + mv grub.n /etc/default/grub + echo "----------- Move and config Grub: DONE ----" +} ## Install Salt -# Install -add-apt-repository ppa:saltstack/salt -apt-get update -apt-get install salt-minion -# Config Salt -cp /etc/salt/minion /etc/salt/minion.back -echo "master = 192.168.1.22" >> /etc/salt/minion -# Wait for the answer of the master -salt-minion -l debug +conf_salt (){ + SALT_MASTER="192.168.1.22" + # Install + echo "----------- Add repos for salt -------" + add-apt-repository ppa:saltstack/salt + apt-get update + echo "----------- Install Salt -------------" + apt-get install salt-minion + # Config Salt + echo "---------- Config Salt ---------------" + cp /etc/salt/minion /etc/salt/minion.back + echo "master: $SALT_MASTER" >> /etc/salt/minion + # Wait for the answer of the master + salt-minion -l debug +} +conf_grub +conf_salt