File: cdcontrol-rel

package info (click to toggle)
cdcontrol 1.90-1.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 160 kB
  • ctags: 16
  • sloc: sh: 944; makefile: 26
file content (46 lines) | stat: -rwxr-xr-x 1,100 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# Show the report of all writes done by CDControl

cdc_rel() {
 local L_TMPFILE
if ! ls -F ${LOG_DIR}|grep -v '/'|grep '[a-zA-Z]';then
     ${DIALOG} --backtitle $"CDcontrol v${CDC_VERSION}" \
         --msgbox $"'No one report was found. Press <Enter> to return" 0 0
 exit 1
fi

# Create the temporary file that will be used for return value of dialog menus
L_TMPFILE=`mktemp /tmp/fileXXXXXX`


while true;do
 ${DIALOG} --backtitle $"CDcontrol v${CDC_VERSION}" --clear \
        --title $"Show a report" \
        --menu $"Use the arrow keys and press <Enter>.\n\
Press <Esc> ou select 'Cancel' to exit:" 20 60 10 \
`ls -F ${LOG_DIR} | grep -v '/' | sed -e s/"^"/"\""/ | \
  sed -e s/"$"/'\" \"\" \\ '/` 2>${L_TMPFILE}

 L_RETVAL=$?
 L_REL_NAME=`cat ${L_TMPFILE}`

 case ${L_RETVAL} in
   0)
    L_REL_NAME=`echo ${L_REL_NAME}|sed -e s/"\""//g`
    clear
    ${PAGER-more} ${LOG_DIR}/${L_REL_NAME}
    echo $"Press ENTER to continue";read
   ;;
   1)
     rm -f ${L_TMPFILE}
     exit 1
     ;;
   255)
     rm -f ${L_TMPFILE}
     exit 1
     ;;
 esac
done
rm -f ${L_TMPFILE}
}
cdc_rel