Skip to content
Snippets Groups Projects
Commit e275f5ce authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Changed default network values.

parent 4b90d703
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
source /root/envsetup/global-conf.sh
echo -e "
${RED}Customer parameters will be applied after rebooting. Note that you won't be able to login to the machine after this operation !${NC}"
echo -e "${RED}Customer parameters will be applied after rebooting. Note that you won't be able to login to the machine after this operation !${NC}"
# set customer IP (/etc/network/interfaces)
sed -i "s@192\.168\.40\.10.*@${NETWORK_IP}@" /etc/network/interfaces
sed -i "s@255\.255\.252\..*@${NETWORK_MASK}@" /etc/network/interfaces
sed -i "s@192\.168\.40\..*@${NETWORK_GATEWAY}@" /etc/network/interfaces
if ( ! test -z ${NETWORK_IP} ); then
sed -i "s@192\.168\.40\.10.*@${NETWORK_IP}@" /etc/network/interfaces
fi
if ( ! test -z ${NETWORK_MASK} ); then
sed -i "s@255\.255\.252\..*@${NETWORK_MASK}@" /etc/network/interfaces
fi
if ( ! test -z ${NETWORK_GATEWAY} ); then
sed -i "s@192\.168\.40\..*@${NETWORK_GATEWAY}@" /etc/network/interfaces
fi
# backup-server specific
if ( test -f /usr/sbin/burp )
then
# changer burp status IP
sed -i "s@^BURP_CLIENT_MAIL_DEST=.*@BURP_CLIENT_MAIL_DEST=${BURP_CLIENT_MAIL_DEST}@" /root/burp-custom.sh
sed -i "s@admin: .*@admin: ${BURP_CLIENT_MAIL_DEST}" /etc/aliases
newaliases
if ( test -f /usr/sbin/burp ); then
# changer burp status IP
sed -i "s@^BURP_CLIENT_MAIL_DEST=.*@BURP_CLIENT_MAIL_DEST=${BURP_CLIENT_MAIL_DEST}@" /root/burp-custom.sh
sed -i "s@admin: .*@admin: ${BURP_CLIENT_MAIL_DEST}" /etc/aliases
newaliases
fi
# set customer DNS
echo "nameserver ${NETWORK_DNS1}" > /etc/resolv.conf
echo "nameserver ${NETWORK_DNS2}" >> /etc/resolv.conf
if ( ! test -z ${NETWORK_DNS1} ); then
echo "nameserver ${NETWORK_DNS1}" > /etc/resolv.conf
if ( ! test -z ${NETWORK_DNS2} ); then
echo "nameserver ${NETWORK_DNS2}" >> /etc/resolv.conf
fi
fi
# set customer NTP
sed -i "s@^server .*@@" /etc/ntp.conf
echo "" >> /etc/ntp.conf
if ( ! test -z ${NTP_SERVER} )
then
echo "server ${NTP_SERVER}" >> /etc/ntp.conf
if ( ! test -z ${NTP_SERVER} ); then
echo "server ${NTP_SERVER}" >> /etc/ntp.conf
fi
service ntp restart
# set email sender
if ( ! test -z ${EMAIL_SENDER} )
then
echo "#DEFAULT_FROM_EMAIL = '${EMAIL_SENDER}'" >> /etc/mediaserver/msconf.py
echo "#DEFAULT_FROM_EMAIL = '${EMAIL_SENDER}'" >> /home/skyreach/htdocs/skyreach_site/settings_override.py
if ( ! test -z ${EMAIL_SENDER} ); then
echo "#DEFAULT_FROM_EMAIL = '${EMAIL_SENDER}'" >> /etc/mediaserver/msconf.py
echo "#DEFAULT_FROM_EMAIL = '${EMAIL_SENDER}'" >> /home/skyreach/htdocs/skyreach_site/settings_override.py
fi
# set locale
......
......@@ -74,13 +74,13 @@ CELERITY_WORKER_IP='127.0.1.1'
# -- Network configuration --
# applied with envsetup-launcher.sh client
NETWORK_IP=0
NETWORK_DNS1=0
NETWORK_DNS2=0
NETWORK_MASK=0
NETWORK_GATEWAY=0
NETWORK_IP=
NETWORK_DNS1=
NETWORK_DNS2=
NETWORK_MASK=
NETWORK_GATEWAY=
# define this if IP is NATed
NETWORK_IP_NAT=0
NETWORK_IP_NAT=
# proxy
PROXY_HTTP=
PROXY_HTTPS=
......
......@@ -68,7 +68,7 @@ if os.path.isfile('../utils.py'):
)
for conf_resolver_key in conf_resolvers_keys:
conf_resolver = conf.get(conf_resolver_key)
if conf_resolver != '0' and conf_resolver not in resolvers:
if conf_resolver and conf_resolver != '0' and conf_resolver not in resolvers:
print('Resolver %s not configured on the system' % conf_resolver)
all_ok = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment