#!/bin/sh

# We only do anything in here if the interface is set to manual config 
# in /etc/network/interfaces
if [ "$METHOD" == "manual" ]; then
    exec 1>/dev/ttymxc0
    exec 2>/dev/ttymxc0

    # Get the network settings from the netsettings.sh script
    source /app/bin/netsettings.sh
    
	if [ "$SSH_ENABLED" = "Y" ]; then
		exec 1>/dev/ttymxc0
		exec 2>/dev/ttymxc0
		
		# Start DHCP if it not already started
		if [ ! -f /var/run/sshd.pid ]; then
			echo S20sshd: Bringing up sshd
			/usr/sbin/sshd
		else
			echo S20sshd: sshd already up
		fi
	fi
fi
