Nameservers

This commit is contained in:
Bob Motram 2015-02-07 10:06:34 +00:00
parent 910308a2e7
commit a7e41c20f8
1 changed files with 18 additions and 16 deletions

View File

@ -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