Commit 7a215909 authored by Girish Ramakrishnan's avatar Girish Ramakrishnan

move config.ini template creation to start.sh

parent ee2e1167
......@@ -36,8 +36,7 @@ function getConfig() {
try {
config = ini.parse(fs.readFileSync(CONFIG_FILE_PATH, 'utf-8'));
} catch (e) {
console.log('No config file found, creating empty one');
fs.writeFileSync(CONFIG_FILE_PATH, '[roles]\n# Restart the app and re-login for role change to take effect\n#admins=username1,username2\n');
console.log('No config file found');
}
config.roles = config.roles || {};
config.roles.admins = config.roles.admins || '';
......
......@@ -31,6 +31,7 @@ echo "==> Creating CRL"
# Writing OpenVPN config
echo "==> Generating OpenVPN config"
[[ ! -f /app/data/openvpn.conf ]] && cp /app/code/openvpn.conf.template /app/data/openvpn.conf
[[ ! -f /app/data/config.ini ]] && echo -e "[roles]\n# Restart the app and re-login for role change to take effect\n#admins=username1,username2\n" > /app/data/config.ini
sed -e "s/^port .*/port ${VPN_TCP_PORT:-}/" \
-e "s/^push \"dhcp-option DOMAIN .*\"/push \"dhcp-option DOMAIN ${CLOUDRON_APP_DOMAIN}\"/" \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment