Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
#!/bin/bash
# This file:
#      http://angg.twu.net/PLURALL/plurall-inst.html
#      http://angg.twu.net/PLURALL/plurall-inst
# See: http://ubuntuforums.org/showthread.php?t=620057
# Status: VERY preliminary - I have tested this very little;
# no docs at all.
# Notes:
# (find-sh0 "date")
# (find-man "1 tee" "-a")
# (find-man "1 bash")
# (find-man "1 bash" "set [--abefhkmnptuvxBCHP]")
# (find-man "1 bash" "set [--abefhkmnptuvxBCHP]" "-e")
# (find-wget "http://www.datakeylive.com/ubuntu/dists/gutsy/wjeremy.key")
# (find-wget "http://www.datakeylive.com/ubuntu/dists/gutsy/alivesoftware.key")
# (find-fline "/etc/apt/sources.list")
# (find-fline "/etc/X11/xorg.conf")
# (find-man "5 sources.list")
# (find-man "5 xorg.conf")
# (find-man "8 apt-key")
#
# Tests:
# (find-sh "~/PLURALL/plurall-inst")
# (find-sh "~/PLURALL/plurall-inst a")
# (find-sh "~/PLURALL/plurall-inst a e")
# (find-sh "~/PLURALL/plurall-inst set-e a false e")

# THISFILE="/etc/plurall-inst"
THISFILE=$0
VERSION=2008may02


run  () { echo "$*"; eval $*; }
crun () { echo "# Running: $*"; eval $*; }
myheader () {
  echo "# Added by $THISFILE (version $VERSION)"
  echo "# On $(date)"
  echo "# See: (find-fline \"$THISFILE\")"
}
myappendto () {
  # Choose one of these...
  # FILE=$1
  # FILE="/tmp/$(echo $1 | tr / _)"
  #
  FILE="/tmp/$(echo $1 | tr / _)"
  run  "echo >> $FILE"
  echo "cat  >> $FILE <<'%%%'"
  tee -a $FILE
  echo "%%%"
}


sources.list-block () {
  echo "deb     http://www.datakeylive.com/ubuntu gutsy main"
  echo "deb-src http://www.datakeylive.com/ubuntu gutsy main"
}
xorg.conf-block () {
cat <<'%%%'
Section "Files"
       # path to defoma fonts
       FontPath "/usr/share/fonts/X11/misc"
       FontPath "/usr/share/fonts/X11/100dpi/:unscaled"
       FontPath "/usr/share/fonts/X11/75dpi/:unscaled"
       FontPath "/usr/share/fonts/X11/Type1"
       FontPath "/usr/share/fonts/X11/100dpi"
       FontPath "/usr/share/fonts/X11/75dpi"
       FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection
%%%
}


add-repository-to-sources.list () {
  crun "{ myheader; sources.list-block; } | myappendto /etc/apt-sources.list"
}
add-apt-keys () {
  run "wget http://www.datakeylive.com/ubuntu/dists/gutsy/wjeremy.key       -O - | apt-key add -"
  run "wget http://www.datakeylive.com/ubuntu/dists/gutsy/alivesoftware.key -O - | apt-key add -"
}
apt-get-install-freenx-debs () {
  run "apt-get install expect openssh-server tcl8.4 libxcomp2 libxcompext2 libxcompshad nxlibs nxagent nxproxy nxclient freenx-server smbfs"
}
add-fontpath-to-xorg.conf () {
  crun "{ myheader; xorg.conf-block; } | myappendto /etc/X11/xorg.conf"
}

echo "# Running:"
echo "#   $0 $*"
echo "#"
echo "# Running as: USER=$USER UID=$UID"
echo "# (Should be: USER=root UID=0)"
echo ""
run "a () { crun add-repository-to-sources.list; }"
run "b () { crun add-apt-keys; }"
run "c () {  run apt-get update; }"
run "d () { crun apt-get-install-freenx-debs; }"
run "e () { crun add-fontpath-to-xorg.conf; }"
echo
echo "# To abort on errors run this:"
run "set-e () { run set -e; }"
echo ""
echo "# Examples of usage:"
echo "#   $0 a b c"
echo "#   $0 set-e a false e"
echo "#"
echo '# Running: for cmd in $*; do echo; crun $cmd; done'
                 for cmd in $*; do echo; crun $cmd; done