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
## 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