File: spacechart.sh

package info (click to toggle)
spacechart 0.9.5-13
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,288 kB
  • ctags: 1,861
  • sloc: ansic: 10,998; sh: 3,348; yacc: 935; perl: 679; makefile: 334; lex: 150
file content (53 lines) | stat: -rw-r--r-- 1,123 bytes parent folder | download
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
47
48
49
50
51
52
53
#!/bin/sh
#########################################
## Install and remove SpaceChart stardata
##
#########################################

set -e

test -x /usr/bin/spacechart || exit 0

if [ -z "$2" ] ; then
    exit 0
fi
 


GLIESE_CONV=/usr/share/spacechart/converters/gliese2spacechart
GLIESE_IN=/usr/share/stardata/gliese/catalog.dat
GLIESE_OUT=/var/lib/spacechart/gliese.dat
GLIESE_SL=/usr/share/spacechart/gliese.dat

case $1 in
    install)
    if [ "$2" = "gliese" ] ; then
	
	if [ -r $GLIESE_IN ] ; then
	    echo "Found Gliese catalogue data; converting to spacechart format."
	    $GLIESE_CONV $GLIESE_IN > $GLIESE_OUT
	    echo "Creating symlink to Gliese catalogue"
	    if [ -f $GLIESE_SL ] || [ -L $GLIESE_SL ] ; then
		rm $GLIESE_SL
	    fi
	    ln -s $GLIESE_OUT $GLIESE_SL
	fi
    fi
    ;;

    remove)
    if [ "$2" = "gliese" ] ; then
	if [ -f $GLIESE_SL ] || [ -L $GLIESE_SL ] ; then
	    echo "Removing Spacechart symlink to Gliese catalogue."
	    rm $GLIESE_SL
	fi
	if [ -f $GLIESE_OUT ] ; then
	    echo "Removing Spacechart Gliese catalogue."
	    rm $GLIESE_OUT
	fi
    fi
    ;;

esac

exit 0