]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/system/cloud-init
2 ########################################################################
3 # Begin $rc_base/init.d/cloud-init
4 ########################################################################
11 # Check if we are running in the cloud
12 if running_on_ec2
; then
13 scriptname
="/etc/rc.d/helper/aws-setup"
14 elif running_on_azure
; then
15 scriptname
="/etc/rc.d/helper/azure-setup"
17 # This system is not running in the cloud
21 # Find the first interface to use
22 for i
in /sys
/class
/net
/red
* /sys
/class
/net
/eth
* \
24 [ -d "${i}" ] ||
continue
28 [ "${i}" = "lo" ] && continue
30 # Use whatever we have found
35 # Check if we found a network interface
36 if [ ! -n "${intf}" ]; then
39 boot_mesg
-n "Could not find a network interface" ${FAILURE}
40 boot_mesg
"" ${NORMAL}
43 # Run a DHCP client and set up the system accordingly
44 dhclient
-sf "${scriptname}" "${intf}"
46 # End DHCP client immediately
47 dhclient
-sf "${scriptname}" -r "${intf}" &>/dev
/null
49 # Rename network devices
50 udevadm trigger
--action="add" --subsystem-match="net"
57 if running_on_ec2
; then
58 echo "This system is running on AWS EC2"
62 elif running_on_azure
; then
63 echo "This system is running on Microsoft Azure"
68 echo "This system is NOT running in the cloud"
74 echo "Usage: ${0} {start|status}"
79 # End $rc_base/init.d/cloud-init