#!/bin/sh #nasty little script to configure the gumstix after being flashed. echo "This will set up your gumstix after being flashes with a proper root_fs" echo "Enter the IP for this gumstix" read IP echo "The following will be the netmask, broadcast address, and gateway for the IP you specified:" netmask=255.255.255.0 bcast="`echo $IP | cut -d . -f 1-3`.255" gateway="`echo $IP | cut -d . -f 1-3`.1" echo "$netmask" echo "$bcast" echo "$gateway" cat > /etc/default/bluetooth << _EOF # Bluetooth configuraton file # Bind to a serial port by default? HCIATTACH_ENABLE=true HCIATTACH_TTY=/dev/ttyS1 HCIATTACH_TYPE=ericsson HCIATTACH_START_SPEED=57600 HCIATTACH_SPEED=921600 HCIATTACH_HANDSHAKE= # Start of hcid (allowed values are "true" and "false") HCID_ENABLE=true # Config file for hcid HCID_CONFIG="/etc/bluetooth/hcid.conf" # Start sdpd (allowed values are "true" and "false") SDPD_ENABLE=true # Start hidd (allowed values are "true" and "false") HIDD_ENABLE=false # Arguments to hidd HIDD_OPTIONS="" # Run hid2hci (allowed values are "true" and "false") HID2HCI_ENABLE=false # Bind rfcomm devices (allowed values are "true" and "false") RFCOMM_ENABLE=true # Config file for rfcomm RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf" # Start dund (allowed values are "true" and "false") DUND_ENABLE=false # Arguments to dund DUND_OPTIONS="--listen --persist" # Start pand (allowed values are "true" and "false") PAND_ENABLE=true # Arguments to pand PAND_OPTIONS="--role PANU --search --persist" _EOF cat > /etc/network/interfaces << _EOF # Configure Loopback auto lo iface lo inet loopback #auto usb0 iface usb0 inet dhcp iface bnep0 inet static _EOF echo "address $IP" >> /etc/network/interfaces echo "broadcast $bcast" >> /etc/network/interfaces echo "netmask $netmask" >> /etc/network/interfaces echo "gateway $gateway" >> /etc/network/interfaces echo "up /bin/ping -c 1 1.1.1.1" >> /etc/network/interfaces cat >> /etc/network/interfaces << _EOF iface eth0 inet dhcp iface wlan0 inet dhcp _EOF cat > /etc/init.d/S98ttyS2 << _EOF #!/bin/sh NAME=ttyS2 case "\$1" in start) echo "Setting up /dev/ttyS2 (Second exposed port)..." stty -F /dev/ttyS2 -ixon speed 115200 ;; stop) echo "Nothing to stop..." ;; *) echo "Usage: \$NAME {start|stop}" ;; esac _EOF cat > /etc/resolv.conf << _EOF2 domain cs-private.gmu.edu nameserver 129.174.44.12 nameserver 129.174.1.3 _EOF2 echo "DONE! Thankyou for using this utility." echo "This utility brought to you by Andrew Bovill." cat > /etc/init.d/S99keep_alive << _EOF #!/bin/sh NAME=keep-alive case "\$1" in start) echo "Starting keep-alive heartbeat" /etc/init.d/keep_alive.sh & ;; stop) echo "Nothing to stop..." ;; *) echo "Usage: \$NAME {start|stop}" ;; esac _EOF cat > /etc/init.d/keep_alive.sh << _EOF #!/bin/sh echo "Starting keep-alive heartbeat..." while \$l do ping -c 1 1.1.1.1 > /dev/null sleep 60 done _EOF chmod a+rx /etc/init.d/keep_alive.sh chmod a+rx /etc/init.d/S99keep_alive chmod a+rx /etc/init.d/S98ttyS2