summaryrefslogtreecommitdiffstats
path: root/games/dwarffortress/dwarffortress
blob: da0506a2c3acb1e07c642632091727fe4c5daed5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
# Slackware wrapper for the dwarffortress executable.
# A copy of the game is in /opt/dwarffortress
# When a user runs the game these files are copied to
# their home directory, and the game runs from there.
runme(){
    if [ ! -d ~/.dwarffortress ]; then
	cp -a /opt/dwarffortress ~/.dwarffortress
	cd ~/.dwarffortress
    fi
    cd ~/.dwarffortress
    ~/.dwarffortress/run_df
}

if [ $UID == 0 ]; then
    read -p "You are currently running as root...\
 Are you sure you want to proceed? (N/y): " resp
    case "$resp" in
	y|yes)
	    runme
	    ;;
	*)
	    echo Exiting
	    exit 0
	    ;;
    esac
else
    runme
fi