From 826bf476257b60e0cf74eeafa8209b38be6899f4 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Sat, 5 Oct 2019 20:05:14 +0200 Subject: [PATCH] Set local_ and remote_ vars --- save.game.link | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/save.game.link b/save.game.link index 61ac2bf..2fe0479 100755 --- a/save.game.link +++ b/save.game.link @@ -1,10 +1,15 @@ #!/bin/sh # Vars {{{ -remote_dir="${HOME}/Nextcloud/games/linux.sgl.script" +## Steam {{{ +steam_id="112595584" +steam_userdata=".steam/steam/userdata/${steam_id}" +## }}} -steam_id="1" -steam_userdata="${HOME}/.steam/steam/userdata/${steam_id}" +remote_dir="${HOME}/Nextcloud/games/linux.sgl.script" +remote_steam_userdata="${remote_dir}/${steam_userdata}" + +local_steam_userdata="${HOME}/${steam_userdata}" # }}} # Tests {{{ @@ -16,11 +21,11 @@ if [ ! -d "${remote_dir}" ]; then fi ## }}} ## Ensure Steam dir exist {{{ -if [ ! -d "${steam_userdata}" ]; then +if [ ! -d "${local_steam_userdata}" ]; then printf '\e[1;35m%-6s\e[m\n' "The Steam directory for your ID (${steam_id}) doesn't exists yet… Should it must be create (for restoration,…) [Y/n] ?" - read -r create_steam_userdata - if [ "${create_steam_userdata}" = "" ] || [ "${create_steam_userdata}" = "Y" ] || [ "${create_steam_userdata}" = "y" ]; then - mkdir -p -- "${steam_userdata}" + read -r create_local_steam_userdata + if [ "${create_local_steam_userdata}" = "" ] || [ "${create_local_steam_userdata}" = "Y" ] || [ "${create_local_steam_userdata}" = "y" ]; then + mkdir -p -- "${local_steam_userdata}" else printf '\e[1;35m%-6s\e[m\n' "Steam directory doesn't exists, abort script." exit 2