From a7e41c20f83a43875b3f481b737f994bfc8d2441 Mon Sep 17 00:00:00 2001 From: Bob Motram Date: Sat, 7 Feb 2015 10:06:34 +0000 Subject: [PATCH] Nameservers --- src/freedombone-prep | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/freedombone-prep b/src/freedombone-prep index 19885d29..8ec2adc5 100755 --- a/src/freedombone-prep +++ b/src/freedombone-prep @@ -65,24 +65,25 @@ if [[ $NO_OF_ARGS == 0 ]]; then exit 0 fi -if [ ! -d $MICROSD_MOUNT_POINT ]; then - if [ -d /media ]; then - # different directories for Debian - if [ -d /media/usb1 ]; then - MICROSD_MOUNT_POINT=/media - ROOTFS=usb1 - fi - if [ -d /media/usb0 ]; then - MICROSD_MOUNT_POINT=/media - BOOT=usb0 - fi +if [ -d /media ]; then + # different directories for Debian + if [ -d /media/usb1 ]; then + MICROSD_MOUNT_POINT=/media + ROOTFS=usb1 fi - if [ ! -d $MICROSD_MOUNT_POINT ]; then - echo "The mount directory $MICROSD_MOUNT_POINT does not exist." - echo 'Use the --mount option to specify where the microSD gets mounted to.' - exit 67563 + if [ -d /media/usb0 ]; then + MICROSD_MOUNT_POINT=/media + BOOT=usb0 fi fi +if [ ! -d $MICROSD_MOUNT_POINT ]; then + echo "The mount directory $MICROSD_MOUNT_POINT does not exist." + echo 'Use the --mount option to specify where the microSD gets mounted to.' + exit 67563 +fi + +echo "MICROSD_MOUNT_POINT=$MICROSD_MOUNT_POINT" +echo "BOOT=$BOOT" while [[ $# > 1 ]] do @@ -174,6 +175,7 @@ SUDO= if [ -f /usr/bin/sudo ]; then SUDO='sudo' fi +$SUDO apt-get install u-boot-tools dosfstools git-core kpartx wget parted $SUDO ./setup_sdcard.sh --mmc $MICROSD_DRIVE --dtb beaglebone echo '' @@ -214,7 +216,7 @@ fi $SUDO cp $MICROSD_MOUNT_POINT/$BOOT/bbb-uEnv.txt $MICROSD_MOUNT_POINT/$BOOT/uEnv.txt $SUDO sed -i 's/iface eth0 inet dhcp/iface eth0 inet static/g' $MICROSD_MOUNT_POINT/$ROOTFS/etc/network/interfaces -$SUDO sed -i '/iface eth0 inet static/a\ dns-nameservers 213.73.91.35 85.214.20.141' $MICROSD_MOUNT_POINT/$ROOTFS/etc/network/interfaces +$SUDO sed -i "/iface eth0 inet static/a\ dns-nameservers $NAMESERVER1 $NAMESERVER2" $MICROSD_MOUNT_POINT/$ROOTFS/etc/network/interfaces $SUDO sed -i "/iface eth0 inet static/a\ gateway $ROUTER_IP_ADDRESS" $MICROSD_MOUNT_POINT/$ROOTFS/etc/network/interfaces $SUDO sed -i '/iface eth0 inet static/a\ netmask 255.255.255.0' $MICROSD_MOUNT_POINT/$ROOTFS/etc/network/interfaces $SUDO sed -i "/iface eth0 inet static/a\ address $BBB_FIXED_IP_ADDRESS" $MICROSD_MOUNT_POINT/$ROOTFS/etc/network/interfaces