You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.0 KiB
58 lines
1.0 KiB
#!/usr/bin/env bash
|
|
|
|
set -eu
|
|
|
|
DESC="Configuration de base de bigboss (hostname, hosts, interfaces)."
|
|
|
|
run() {
|
|
|
|
. $VDN_PATH/bin/functions-scripts.sh
|
|
|
|
setErrorHandler
|
|
echoStart
|
|
|
|
name="bigboss"
|
|
|
|
startAndWaitSsh $name
|
|
|
|
setIpv6WorkAround $name
|
|
setHostname $name
|
|
|
|
cat << EOF | setHosts $name
|
|
127.0.0.1 localhost
|
|
|
|
$($VDN_PATH/bin/vdn-infos lambda PUBLIC_IP) lambda
|
|
$($VDN_PATH/bin/vdn-infos nomade PUBLIC_IP) nomade
|
|
|
|
192.168.30.1 societe
|
|
192.168.30.2 bigboss
|
|
192.168.30.16 tiny
|
|
|
|
192.168.1.2 web
|
|
EOF
|
|
|
|
cat << EOF | setInterfaces $name
|
|
# This file describes the network interfaces available on your system
|
|
# and how to activate them. For more information, see interfaces(5).
|
|
|
|
# The loopback network interface
|
|
auto lo
|
|
iface lo inet loopback
|
|
|
|
auto eth0
|
|
iface eth0 inet static
|
|
address 192.168.30.2
|
|
netmask 255.255.255.0
|
|
gateway 192.168.30.1
|
|
|
|
EOF
|
|
|
|
vdn-ssh root@$name "
|
|
echo \"<html><body><h1>Bienvenue sur le serveur Web de $name !</h1></body></html>\" > /var/www/html/index.html
|
|
systemctl restart networking
|
|
"
|
|
unsetErrorHandler
|
|
echoDone
|
|
}
|
|
|