Skip to content

Instantly share code, notes, and snippets.

@daktak
Created December 14, 2021 08:35
Show Gist options
  • Select an option

  • Save daktak/d40f4f07e77b0a1d379e2ba7436cdba6 to your computer and use it in GitHub Desktop.

Select an option

Save daktak/d40f4f07e77b0a1d379e2ba7436cdba6 to your computer and use it in GitHub Desktop.

Revisions

  1. daktak created this gist Dec 14, 2021.
    49 changes: 49 additions & 0 deletions zwift_world.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    #!/bin/bash
    USER=`whoami`
    DIR="/home/${USER}/Games/zwift/drive_c/users/daktak/Documents/Zwift"
    case $1 in
    1 | Watopia )
    WORLD=2
    ;;

    2 | Richmond )
    WORLD=2
    ;;

    3 | London )
    WORLD=3
    ;;

    4 | "New York" | NY )
    WORLD=4
    ;;

    5 | Innsbruck )
    WORLD=5
    ;;

    7 | Yorkshire )
    WORLD=7
    ;;

    9 | "Makuri Island" | MI )
    WORLD=9
    ;;

    10 | France )
    WORLD=10
    ;;

    11 | Paris )
    WORLD=11
    ;;

    esac
    if [[ -z $WORLD ]]; then
    xmlstarlet ed --inplace -d //ZWIFT//WORLD \
    $DIR/prefs.xml
    else
    xmlstarlet ed --inplace \
    --subnode ZWIFT --type elem --name "WORLD" --value $WORLD \
    $DIR/prefs.xml
    fi