Saturday, December 21, 2013

Feed the Beast Ubuntu install script

This is a simple install script I made for Feed the Beast. It will set up the launcher in the actual applications folder, which makes it easier to add to steam and your desktop. Also included the icon for it.

#!/bin/bash

USRDIR=/usr/share/feedthebeast

if [ "$(id -u)" != "0" ]; then
   echo "Must be root." 1>&2
   read
   exit 1
fi

echo "Setting up install..."
mkdir "$USRDIR"
cd "$USRDIR"

echo "Downloading files..."
wget -O FTB_Launcher.jar "http://www.creeperrepo.net/direct/FTB2/881b4fb9d6df8ed81144c9e09c867e6b/launcher%5EFTB_Launcher.jar"
wget -O ftbicon.png "https://lh5.googleusercontent.com/VGBHxrBBaQL1YZmxT2bcxOTWaE-HsAPaziXtisc5kFRVsOqKWWwOEc28uTPqM7lRsg=w1278-h518"

echo "Adding application..."
cat <<_END > /usr/games/feedthebeast
#!/bin/bash

java -jar $USRDIR/FTB_Launcher.jar
_END
chmod +x /usr/bin/feedthebeast

cd /usr/share/applications

cat <<_END > feedthebeast.desktop
[Desktop Entry]
Name=Feed the Beast
GenericName=Feed the Beast
Comment=Feed the Beast
Exec=/usr/games/feedthebeast
Terminal=false
Type=Application
Icon=/usr/share/feedthebeast/ftbicon.png
_END

echo "Adding man page..."
cd /tmp
cat <<_END > /tmp/feedthebeast.6
.\" Manpage for Feed The Beast.
.TH man 6 "$(date +'%d %b %Y')" "1.0" "feedthebeast man page"
.SH NAME
feedthebeast \- Launch client
.SH SYNOPSIS
feedthebeast
.SH DESCRIPTION
Launches Feed the Beast client launcher
_END
gzip -c /tmp/feedthebeast.6 > /usr/share/man/man6/feedthebeast.6.gz

echo "Updating database..."
cd /usr/share/man/man6
mandb -q

echo "Installation complete."
echo "May require relog to show up."
read -p "Press enter to end. "

Thursday, December 19, 2013

Purge old man pages for apropos

This is something I wanted to do for a while on Ubuntu, and I'm not sure if it will work on other distributions. The main problem is that I would remove a program and the man page for it would remain. This gets annoying when I'm searching for stuff and end up double checking on what was removed or decide to try a command I removed. The solution is simple, but takes a few minutes to run. As root, run these commands.

cd /usr/share/man
rm -R /var/cache/man
mandb

As simple as that and all the old stuff gets removed. This just simply removed the cached manual pages then reconstructs it.

Tag Cloud

.NET (1) A+ (2) addon (6) Android (4) anonymous functions (5) application (10) arduino (1) artificial intelligence (2) bash (4) c (7) camera (1) certifications (4) cobol (1) comptia (4) computing (2) css (2) customize (16) encryption (2) error (19) exploit (17) ftp (3) funny (2) gadget (3) games (2) Gtk (1) GUI (5) hardware (7) haskell (15) help (8) HTML (6) irc (2) java (5) javascript (21) Linux (20) Mac (5) malware (2) math (8) network (9) objects (2) OCaml (1) perl (4) php (9) plugin (7) programming (42) python (24) radio (1) regex (3) security (25) sound (1) speakers (1) ssh (3) story (1) Techs from the Crypt (2) telnet (2) tools (15) troubleshooting (5) Ubuntu (4) Unix (4) virtualization (1) web design (14) Windows (8) wx (2)