2 # ============================================================================
4 # Copyright (C) THALES. All rights reserved
5 # Author: Laurent Mazet
8 # ============================================================================
10 # Install new lgcore delivery
16 PROGNAME
=$
(basename $0)
17 REPOSITORY
="/opt/trc6500/debian-rep"
18 TMPLOG
=/tmp
/$PROGNAME-$$.log
24 echo "usage: $PROGNAME [-h] [-r dir] [-v] <mode>"
25 echo " install new version from lgcore delivery from"
26 echo " - usb: usb key slotted on master blade"
27 echo " - file: file stored in a special repository"
30 echo " -h: help message"
31 echo " -r: change repository (default is $REPOSITORY)"
38 function title
() { echo -e "\033[0;1m$*\033[0;0m"; }
39 function pass
() { echo -e "\033[1;32m$*\033[0;0m"; }
40 function warn
() { echo -e "\033[1;33m$*\033[0;0m"; }
41 function fail
() { echo -e "\033[1;31m$*\033[0;0m"; }
47 $@
2>$TMPLOG && pass OK ||
{ fail KO
; cat $TMPLOG; exit 1; }
53 while [ $# -gt 0 ]; do
56 -r) shift; REPOSITORY
=$1;;
57 -v) echo "$PROGNAME version $VER"; exit 0;;
66 [ "$MODE" ] ||
{ fail
"need mode (file or usb)"; exit 1; }
72 file) DIR
=$REPOSITORY;;
75 check mount
/dev
/sdb1
$DIR
76 trap "umount $DIR;" 0 1 2 15
81 echo -n "look for delivery file: "
82 LIV
=$
(find $DIR -name liv\
*.sfx
2>$TMPLOG |
sort |
tail -1)
83 [ -f "$LIV" ] && pass OK ||
{ fail KO
; cat $TMPLOG; exit 1; }
86 # install lgcore delivery
90 # vim:set tabstop=4 expandtab shiftwidth=4: