#!/bin/bash

# 
# Helper functions needed by all the Ferry images. 
# This script should not be modified by the container. 
#

function create_fuse_dev {
    # We'll need to create /dev/fuse since we removed 
    # it during the installation (since build doesn't support
    # privileged operations)
    if [ ! -e /dev/fuse ]; then
	mknod /dev/fuse c 10 229
    fi
}

function pophosts {
    # Populate the /etc/hosts file with the contents of
    # 'instances' file. 
    input=/service/sconf/instances
    while read line
    do
	split=( $line )
	name=${split[1]}
	echo $line >> /etc/hosts
    done < "$input"
}