aboutsummaryrefslogtreecommitdiffstats
path: root/games/duke3d/files/fix.sh
blob: 3638c96942670662d4dd9a8e072bebf26d7c7711 (plain) (blame)
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
#!/bin/sh
cd %%DUKEDIR%%

if [ ! -d %%DUKEDIR%% ] || [ ! -w %%DUKEDIR%% ]
then
    echo You do not have permission to write to %%DUKEDIR%%.
    exit
fi

if [ ! -d testdata ]
then
    echo testdata directory is missing
    exit
fi

if [ ! -f testdata/defs.con ] || [ ! -f testdata/game.con ] ||  [ ! -f testdata/user.con ]
then
    echo At least one resource file in testdata is missing
    exit
fi

if [ -f DEFS.CON ]
then                                                             
        echo Backing up original DEFS.CON to DEFS.BAK
    cp DEFS.CON DEFS.BAK
fi

if [ -f GAME.CON ]
then                                                             
        echo Backing up original GAME.CON to GAME.BAK
    cp GAME.CON GAME.BAK
fi

if [ -f USER.CON ]
then                                                             
        echo Backing up original USER.CON to USER.BAK
    cp USER.CON USER.BAK
fi

cp -f testdata/defs.con ./DEFS.CON
cp -f testdata/game.con ./GAME.CON
cp -f testdata/user.con ./USER.CON