@@ -14,7 +14,7 @@ mk_pk3()
14
14
# grabs a patch .zip from archive.org and saves it as a pk3
15
15
grab_patch ()
16
16
{
17
- wget -nc -O ./pak$2 .pk3 http://archive.org/download/hl_shareware_data/valve/$1 .zip
17
+ wget -nc -O ./pak$2 .pk4 http://archive.org/download/hl_shareware_data/valve/$1 .zip
18
18
}
19
19
20
20
SCRPATH=" $( cd " $( dirname $( readlink -nf $0 ) ) " && pwd ) "
@@ -42,18 +42,22 @@ if ! [ -f "$CDROM_PATH"/data1.cab ]; then
42
42
exit 1
43
43
fi
44
44
45
- # Grab the cabinet data off the CD
46
- mkdir -p ./tmp
47
- unshield -d ./tmp x " $CDROM_PATH " /data1.cab
48
-
49
- # Let's shove them all into a convenient .pk3dir
50
- mkdir -p ./$OUTPK3DIR
51
- mv -v ./tmp/Half-Life_PAK_File/valve/pak0.pak ./pak00_cd.pak
52
- rsync -av ./tmp/Half-Life_Program_Files/valve/ ./$OUTPK3DIR /
53
- mv -v ./tmp/Half-Life_Program_Files/media ./$OUTPK3DIR /media
54
- mv -v ./tmp/Half-Life_Program_Files/logos ./$OUTPK3DIR /logos
55
- cd ./$OUTPK3DIR
56
- mk_pk3 pak01_cd
45
+ # Check if we need to do anything
46
+ if ! [ -f " $SCRPATH /pak00_cd.pak" ] || ! [ -f " $SCRPATH /pak01_cd.pk3" ]; then
47
+ # Grab the cabinet data off the CD
48
+ mkdir -p ./tmp
49
+ unshield -d ./tmp x " $CDROM_PATH " /data1.cab
50
+
51
+ # Let's shove them all into a convenient .pk3dir
52
+ mkdir -p ./$OUTPK3DIR
53
+ mv -v ./tmp/Half-Life_PAK_File/valve/pak0.pak ./pak00_cd.pak
54
+ rsync -av ./tmp/Half-Life_Program_Files/valve/ ./$OUTPK3DIR /
55
+ mv -v ./tmp/Half-Life_Program_Files/media ./$OUTPK3DIR /media
56
+ mv -v ./tmp/Half-Life_Program_Files/logos ./$OUTPK3DIR /logos
57
+ cd ./$OUTPK3DIR
58
+ mk_pk3 pak01_cd
59
+ fi
60
+
57
61
cd " $SCRPATH "
58
62
59
63
# Get the latest patch, because that'll fix the menu assets and add more fun, free content
@@ -72,5 +76,42 @@ grab_patch 11071108 14_1108
72
76
grab_patch 11081109 15_1109
73
77
grab_patch 11091110 16_1110
74
78
79
+ # Make sure we're back in here
80
+ cd " $SCRPATH "
81
+
82
+ printf " All done. Would you like to rip the the Compact Disc Digital Audio for music?\ny/n: "
83
+ read CHOICE
84
+
85
+ if [[ " $CHOICE " == [Yy]* ]]; then
86
+ # check if we require rippin tunes
87
+ if ! [ -f " $SCRPATH /music/track02.wav" ] && ! [ -f " $SCRPATH /music/track02.ogg" ]; then
88
+ if [ -x " $( command -v cdparanoia) " ]; then
89
+ mkdir -p " ./music"
90
+ cd " ./music"
91
+ cdparanoia -B
92
+ rename " .cdda." " ." * .wav
93
+
94
+ # Maybe the user does not have the physical disc and cdp fails.
95
+ if [ -f " $SCRPATH /music/track02.wav" ]; then
96
+ # I'd offer FLAC, but that also requires the ffmpeg plugin
97
+ if [ -x " $( command -v oggenc) " ]; then
98
+ printf " All done. Would you like to convert them to OGG for playback compatibility\nas well as space preservation (frees up ~330 MB)?\ny/n: "
99
+ read CHOICE
100
+ if [[ " $CHOICE " == [Yy]* ]]; then
101
+ oggenc * .wav
102
+ rm * .wav
103
+ fi
104
+ fi
105
+ fi
106
+ else
107
+ printf " cdparanoia is missing. Cannot rip music.\nPlease run the installer again once you've got it installed.\n"
108
+ fi
109
+ else
110
+ printf " Music is already present.\n"
111
+ fi
112
+ fi
113
+
114
+ cd " $SCRPATH "
115
+
75
116
rm -rfv ./$OUTPK3DIR
76
117
rm -rfv ./tmp
0 commit comments