Root/nlove/files/nlove-run

1#!/bin/sh
2
3if [ $# -lt 1 ]; then
4    echo "Usage: $0 <name>"
5    exit 1
6fi
7
8if [ ! -f "/usr/share/nlove/$1.love" ]; then
9    echo "Game not found, will now attempt to download it."
10    echo "This requires working internet access."
11    mkdir -p /usr/share/nlove > /dev/null
12    echo "Downloading... "
13    wget -q "http://dl.dropbox.com/u/440010/nlove/games/$1.love" -O "/usr/share/nlove/$1.love" > /dev/null
14    if [ $? -ne 0 ]; then
15        echo "An error occured during downloading, are you sure $1 exists?"
16        echo "And do you have internet access?"
17        exit 1
18    fi
19    echo "Done."
20    echo -n "Installing launcher... "
21    mkdir -p /usr/share/gmenu2x/sections/nlove
22    (echo "title=$1" &&
23    echo "exec=/usr/bin/`basename $0`" &&
24    echo "params=$1" &&
25    echo "wrapper=true") > /usr/share/gmenu2x/sections/nlove/$1
26    echo "Done."
27fi
28nlove "/usr/share/nlove/$1.love"
29exit 0
30

Archive Download this file



interactive