download-steam-games-list.sh
· 696 B · Bash
Исходник
#!/bin/bash
STEAM_USER=LorenDB
STEAM_ALSO_CACHE_WINDOWS=0
DOWNLOAD_GAME_SCRIPT_PATH="/home/loren/.local/bin/download-steam-game.sh"
if [[ "$#" -ne 1 ]]; then
echo "Requires a single argument"
exit 1
fi
GAMES_LIST=$(cat $1)
for game_info in $GAMES_LIST; do
game_name=$(echo $game_info | cut -d ',' -f 1)
game_id=$(echo $game_info | cut -d ',' -f 2)
game_windows_only=$(echo $game_info | cut -d ',' -f 3)
if [[ "$game_windows_only" -eq 1 ]]; then
$DOWNLOAD_GAME_SCRIPT_PATH -u $STEAM_USER -n $game_name -i $game_id -w
else
$DOWNLOAD_GAME_SCRIPT_PATH -u $STEAM_USER -n $game_name -i $game_id
fi
done
1 | #!/bin/bash |
2 | |
3 | STEAM_USER=LorenDB |
4 | STEAM_ALSO_CACHE_WINDOWS=0 |
5 | DOWNLOAD_GAME_SCRIPT_PATH="/home/loren/.local/bin/download-steam-game.sh" |
6 | |
7 | if [[ "$#" -ne 1 ]]; then |
8 | echo "Requires a single argument" |
9 | exit 1 |
10 | fi |
11 | |
12 | GAMES_LIST=$(cat $1) |
13 | for game_info in $GAMES_LIST; do |
14 | game_name=$(echo $game_info | cut -d ',' -f 1) |
15 | game_id=$(echo $game_info | cut -d ',' -f 2) |
16 | game_windows_only=$(echo $game_info | cut -d ',' -f 3) |
17 | |
18 | if [[ "$game_windows_only" -eq 1 ]]; then |
19 | $DOWNLOAD_GAME_SCRIPT_PATH -u $STEAM_USER -n $game_name -i $game_id -w |
20 | else |
21 | $DOWNLOAD_GAME_SCRIPT_PATH -u $STEAM_USER -n $game_name -i $game_id |
22 | fi |
23 | done |