sdf/games.ksh

43 lines
1.3 KiB
Bash
Executable File

#!/bin/ksh
# games.ksh
# This script facilitates remote game play on SDF
# Copyright (C) 2022 Scott C. MacCallum
# scm@sdf.org
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
host=sdf.org
echo "I will get the games list."
echo "When it is displayed, use the up and down arrow keys to navigate it."
echo "Press the Q key to close it."
echo -n "Press the Return/Enter key now until the list displays: "
read key
mosh $USER@$host games > games.txt
# To do: write some logic that checks if games.txt exists, if it does, ask
# the user if they are OK with it be overwritten.
mosh $USER@$host less games.txt
echo -n "Type the name of the game that you want to play: "
read game
mosh $USER@$host $game
exit 0