/[mdap]/tftp-iselect.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /tftp-iselect.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 77 - (show annotations)
Sun Nov 18 15:27:37 2007 UTC (16 years, 4 months ago) by dpavlin
File MIME type: application/x-sh
File size: 874 byte(s)
 r116@brr:  dpavlin | 2007-11-18 16:27:32 +0100
 fix firmware filename parsing by using fixed number of chars (yak!)

1 #!/bin/sh
2
3 tftp=/srv/tftp/
4 tmp=/tmp/tftp
5 fw_info=bin/fw-info.pl
6
7 #which=`find $tftp -type f | xargs -i $fw_info {} 2>/dev/null | sort | sed -e "s!$tftp!!" -e 's!^!<s>!' -e 's!^<s>\(.* BANT-R\)!\1!' | iselect -c -n "Select firmware file"`
8 $fw_info $tftp/ 2>/dev/null | sort -k 2,1 -n | sed -e "s!$tftp/*!!" > $tmp.all
9
10 echo -e "Currently selected version for flash:\n" > $tmp
11
12 grep " BANT-.$" $tmp.all > $tmp.selected
13 cat $tmp.selected >> $tmp
14
15 echo -e "\nAll versions available:\n" >> $tmp
16
17 grep -v -f $tmp.selected $tmp.all | sed -e 's!^!<s>!' >> $tmp
18
19 which=`iselect -c -n "Select firmware" < $tmp`
20
21 test -z "$which" && echo "No change" && exit
22
23 version=`echo $which | cut -d" " -f1`
24 board=`echo $which | cut -d" " -f2`
25 path=`echo $which | cut -c32-`
26
27 cp $tftp/$path $tftp/$board.new && mv $tftp/$board.new $tftp/$board || exit
28
29 echo "Using $path for $board [$version]"
30

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26