functions and paramaters

This commit is contained in:
lafrite 2013-11-13 16:02:11 +01:00
parent e2b3c129a2
commit fdc390d060
1 changed files with 26 additions and 12 deletions

View File

@ -1,20 +1,34 @@
#!/bin/bash #!/bin/bash
## Config de Grub ## Config de Grub
# Save old grub # Save old grub
cp /etc/default/grub /etc/default/grub.back conf_grub (){
sed 's/GRUB_DEFAULT=0/GRUB_DEFAULT=4/g' /etc/default/grub > grub.n GRUB_DEFAULT=1
mv grub.n /etc/default/grub 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 Salt
# Install conf_salt (){
add-apt-repository ppa:saltstack/salt SALT_MASTER="192.168.1.22"
apt-get update # Install
apt-get install salt-minion echo "----------- Add repos for salt -------"
# Config Salt add-apt-repository ppa:saltstack/salt
cp /etc/salt/minion /etc/salt/minion.back apt-get update
echo "master = 192.168.1.22" >> /etc/salt/minion echo "----------- Install Salt -------------"
# Wait for the answer of the master apt-get install salt-minion
salt-minion -l debug # 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