chmod 700 /tmp/aws-user-data.script
# Run the user-data script
- /tmp/aws-user-data.script &>/var/log/user-data.log
+ local now="$(date -u +"%s")"
+ /tmp/aws-user-data.script &>/var/log/user-data.log.${now}
# Delete the script right away
rm /tmp/aws-user-data.script
fi
fi
- # Import any DNS server settings
- eval $(/usr/local/bin/readhash <(grep -E "^DNS([0-9])=" /var/ipfire/ethernet/settings 2>/dev/null))
-
# Import network configuration
# After this, no network connectivity will be available from this script due to the
# renaming of the network interfaces for which they have to be shut down
# The gateway is always the first IP address in the subnet
local gateway="$(to_address $(( netaddress_num + 1 )))"
- # The AWS internal DNS service is available on the second IP address of the VPC
- local dns1="$(to_address $(( vpc_netaddress_num + 2 )))"
- local dns2=
-
(
echo "RED_TYPE=STATIC"
echo "RED_DEV=${interface_name}"
echo "RED_NETADDRESS=${netaddress}"
echo "RED_BROADCAST=${broadcast}"
echo "DEFAULT_GATEWAY=${gateway}"
- echo "DNS1=${DNS1:-${dns1}}"
- echo "DNS2=${DNS2:-${dns2}}"
) >> /var/ipfire/ethernet/settings
# Import aliases for RED
# Save CONFIG_TYPE
echo "CONFIG_TYPE=${config_type}" >> /var/ipfire/ethernet/settings
-
-
# Actions performed only on the very first start
if [ ! -e "/var/ipfire/main/firstsetup_ok" ]; then
+ # Disable using ISP nameservers
+ sed -e "s/^USE_ISP_NAMESERVERS=.*/USE_ISP_NAMESERVERS=off/" -i /var/ipfire/dns/settings
+
# Enable SSH
sed -e "s/ENABLE_SSH=.*/ENABLE_SSH=on/g" -i /var/ipfire/remote/settings