#!/bin/sh game=${0##*/} waddir=/usr/share/games/doom case "$game" in doom1) game=doom ;; esac if ! [ -e "$waddir"/"$game".wad ] then set -- for wad in "$waddir"/*.wad do wad=${wad##*/} wad=${wad%.wad} set -- "$@" "$wad" done exec >&2 echo "Error: No WAD found for $game ('$waddir/$game.wad' not found)" echo "Available WAD files: $@" exit 1 fi savedir=~/.prboom-plus/save/"$game" mkdir -p "$savedir" prboom-plus -save "$savedir" -iwad "$game" -window "$@"