Difference between revisions of "Fs2 open on Linux/Data Installation script"

From FreeSpace Wiki
Jump to: navigation, search
(Colorcode important parts)
 
(3 intermediate revisions by 3 users not shown)
Line 7: Line 7:
 
{{Warning| Please double check and understand the commands you run as root. A single typo could destroy your data. <b>Remember, with great power comes great responsibility.</b>}}
 
{{Warning| Please double check and understand the commands you run as root. A single typo could destroy your data. <b>Remember, with great power comes great responsibility.</b>}}
 
The following script will extract the necessary files to the <font color="yellow">TMPDIR</font> and install them to the specified <font color="pink">FS2DIR</font> from the <font color="lightgreen">CDROM</font>, prompting you for each disk. These values may need to be changed for your system. You may need to run this script as root and don't forget to chmod +x it.
 
The following script will extract the necessary files to the <font color="yellow">TMPDIR</font> and install them to the specified <font color="pink">FS2DIR</font> from the <font color="lightgreen">CDROM</font>, prompting you for each disk. These values may need to be changed for your system. You may need to run this script as root and don't forget to chmod +x it.
  #!/bin/sh
+
  #!/bin/bash
 
  <font color="pink">FS2DIR="$HOME/fs2/data"</font>
 
  <font color="pink">FS2DIR="$HOME/fs2/data"</font>
 
  <font color="yellow">TMPDIR="/tmp/fs2"</font>
 
  <font color="yellow">TMPDIR="/tmp/fs2"</font>
Line 16: Line 16:
 
  read
 
  read
 
  mkdir -p $FS2DIR/players $CDROM $TMPDIR
 
  mkdir -p $FS2DIR/players $CDROM $TMPDIR
 +
 +
# In case of old CD's files come over as read only re running the script complains
 +
chmod +w $FS2DIR/*.vp
 +
 
  for group in "Basic Install Files" "Intel Anims" "Music Compressed" \
 
  for group in "Basic Install Files" "Intel Anims" "Music Compressed" \
 
     "High Res Files" "Hud Config Files";
 
     "High Res Files" "Hud Config Files";
Line 38: Line 42:
 
  rm -vrf $TMPDIR
 
  rm -vrf $TMPDIR
 
  chmod -x $FS2DIR/tango*.vp
 
  chmod -x $FS2DIR/tango*.vp
 +
 +
 +
 +
 +
[[Category:FreeSpace Open on Linux|Data Installation script]]

Latest revision as of 09:20, 15 May 2010

« Installing unshield The fs2_open on Linux Guide
Data Installation script
Post-Compile Configuration »

Warning: Please double check and understand the commands you run as root. A single typo could destroy your data. Remember, with great power comes great responsibility.

The following script will extract the necessary files to the TMPDIR and install them to the specified FS2DIR from the CDROM, prompting you for each disk. These values may need to be changed for your system. You may need to run this script as root and don't forget to chmod +x it.

#!/bin/bash
FS2DIR="$HOME/fs2/data"
TMPDIR="/tmp/fs2"
CDROM="/media/cdrom"
echo ===================================
echo [ Freespace 2 Retail CD Installer ]
echo ===================================
read
mkdir -p $FS2DIR/players $CDROM $TMPDIR

# In case of old CD's files come over as read only re running the script complains
chmod +w $FS2DIR/*.vp

for group in "Basic Install Files" "Intel Anims" "Music Compressed" \
    "High Res Files" "Hud Config Files";
    do unshield -d $TMPDIR -g "$group" -L -j x $CDROM/data1.cab;
done;
mv -v $TMPDIR/*/*.vp $FS2DIR/
mv -v $TMPDIR/*/*.hcf $FS2DIR/players/
umount $CDROM

echo Please mount the second disk onto $CDROM
read
cp -v $CDROM/tango{1,A}_fs2.vp $FS2DIR
mv $FS2DIR/tango{A,a}_fs2.vp
umount $CDROM

echo Please mount the third disk onto $CDROM
read
cp -v $CDROM/tango{2,3,B}_fs2.vp $FS2DIR
mv $FS2DIR/tango{B,b}_fs2.vp
umount $CDROM

rm -vrf $TMPDIR
chmod -x $FS2DIR/tango*.vp