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 #!/bin/bash
source /root/envsetup/global-conf.sh source /root/envsetup/global-conf.sh
echo -e " 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}"
${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) # set customer IP (/etc/network/interfaces)
sed -i "s@192\.168\.40\.10.*@${NETWORK_IP}@" /etc/network/interfaces if ( ! test -z ${NETWORK_IP} ); then
sed -i "s@255\.255\.252\..*@${NETWORK_MASK}@" /etc/network/interfaces sed -i "s@192\.168\.40\.10.*@${NETWORK_IP}@" /etc/network/interfaces
sed -i "s@192\.168\.40\..*@${NETWORK_GATEWAY}@" /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 # backup-server specific
if ( test -f /usr/sbin/burp ) if ( test -f /usr/sbin/burp ); then
then # changer burp status IP
# 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@^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
sed -i "s@admin: .*@admin: ${BURP_CLIENT_MAIL_DEST}" /etc/aliases newaliases
newaliases
fi fi
# set customer DNS # set customer DNS
echo "nameserver ${NETWORK_DNS1}" > /etc/resolv.conf if ( ! test -z ${NETWORK_DNS1} ); then
echo "nameserver ${NETWORK_DNS2}" >> /etc/resolv.conf 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 # set customer NTP
sed -i "s@^server .*@@" /etc/ntp.conf sed -i "s@^server .*@@" /etc/ntp.conf
echo "" >> /etc/ntp.conf echo "" >> /etc/ntp.conf
if ( ! test -z ${NTP_SERVER} ) if ( ! test -z ${NTP_SERVER} ); then
then echo "server ${NTP_SERVER}" >> /etc/ntp.conf
echo "server ${NTP_SERVER}" >> /etc/ntp.conf
fi fi
service ntp restart service ntp restart
# set email sender # set email sender
if ( ! test -z ${EMAIL_SENDER} ) if ( ! test -z ${EMAIL_SENDER} ); then
then echo "#DEFAULT_FROM_EMAIL = '${EMAIL_SENDER}'" >> /etc/mediaserver/msconf.py
echo "#DEFAULT_FROM_EMAIL = '${EMAIL_SENDER}'" >> /etc/mediaserver/msconf.py echo "#DEFAULT_FROM_EMAIL = '${EMAIL_SENDER}'" >> /home/skyreach/htdocs/skyreach_site/settings_override.py
echo "#DEFAULT_FROM_EMAIL = '${EMAIL_SENDER}'" >> /home/skyreach/htdocs/skyreach_site/settings_override.py
fi fi
# set locale # set locale
......
...@@ -74,13 +74,13 @@ CELERITY_WORKER_IP='127.0.1.1' ...@@ -74,13 +74,13 @@ CELERITY_WORKER_IP='127.0.1.1'
# -- Network configuration -- # -- Network configuration --
# applied with envsetup-launcher.sh client # applied with envsetup-launcher.sh client
NETWORK_IP=0 NETWORK_IP=
NETWORK_DNS1=0 NETWORK_DNS1=
NETWORK_DNS2=0 NETWORK_DNS2=
NETWORK_MASK=0 NETWORK_MASK=
NETWORK_GATEWAY=0 NETWORK_GATEWAY=
# define this if IP is NATed # define this if IP is NATed
NETWORK_IP_NAT=0 NETWORK_IP_NAT=
# proxy # proxy
PROXY_HTTP= PROXY_HTTP=
PROXY_HTTPS= PROXY_HTTPS=
......
...@@ -68,7 +68,7 @@ if os.path.isfile('../utils.py'): ...@@ -68,7 +68,7 @@ if os.path.isfile('../utils.py'):
) )
for conf_resolver_key in conf_resolvers_keys: for conf_resolver_key in conf_resolvers_keys:
conf_resolver = conf.get(conf_resolver_key) 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) print('Resolver %s not configured on the system' % conf_resolver)
all_ok = False 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