#!/bin/sh

## live-config(7) - System Configuration Components
## Copyright (C) 2016-2020 The Debian Live team
## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.

set -e

ConfigureNetworkInterfaces ()
{	
	echo -n " network-interfaces"

	echo \
"# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

iface eth0 inet manual
    dhclient /sbin/dhcpcd
    post-up /usr/sbin/dhcpcd -4 $IFACE
    pre-down /usr/sbin/dhcpcd -4 -1 -k $IFACE || :

iface wlan0 inet manual
    dhclient /sbin/dhcpcd
    post-up /usr/sbin/dhcpcd -4 $IFACE
    pre-down /usr/sbin/dhcpcd -4 -1 -k $IFACE || :" > /etc/network/interfaces

	# Creating state file
	touch /var/lib/live/config/interfaces

}

ConfigureNetworkInterfaces
