#!/bin/bash # convert Red Hat config files to Debian interfaces syntax CFG_FILE=$1 if [ -f $CFG_FILE ];then . $CFG_FILE if [ "$BOOTPROTO" = "none" ];then printf "auto $DEVICE\n" printf "iface $DEVICE inet static\n" printf "\taddress $IPADDR\n" printf "\tnetmask $NETMASK\n" printf "\tnetwork $NETWORK\n" printf "\tbroadcast $BROADCAST\n" if [ ! -z $GATEWAY ];then printf "\tgateway $GATEWAY\n" fi printf "\n" else printf "auto $DEVICE\n" printf "iface $DEVICE inet dhcp\n" fi fi