-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
64 lines (54 loc) · 1.17 KB
/
setup.sh
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
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
OSM_DIR="/home/akh/git/OSM"
SRC_DIR="$OSM_DIR/src"
TEST_DIR="$OSM_DIR/src/tests"
FYAMS_DIR="/home/akh/osm/bin"
if [[ $PATH != *$FYAMS_DIR* ]]
then
eval 'export PATH=$FYAMS_DIR:$PATH'
fi
# harddisk control
UTIL="$SRC_DIR/util/tfstool"
HD="$SRC_DIR/fyams.harddisk"
hd () {
if ! [ -e $UTIL ];
then
echo "Couldn't find TFS tool at '$UTIL'."
return 1
fi
if [[ "$1" == "list" ]];
then
$UTIL list $HD
fi
if [[ "$1" == "write" ]];
then
if [[ "$2" != "" ]];
then
$UTIL write $HD $TEST_DIR/$2 $2
else
echo "Usage (write): $0 write <file>"
return 2
fi
fi
if [[ "$1" == "delete" ]];
then
if [[ "$2" != "" ]];
then
$UTIL delete $HD $2
else
echo "Usage (delete): $0 delete <file>"
return 2
fi
fi
if [[ "$1" == "update" ]];
then
if [[ "$2" != "" ]];
then
$UTIL delete $HD $2
$UTIL write $HD $TEST_DIR/$2 $2
else
echo "Usage (update): $0 update <file>"
return 2
fi
fi
}