Set local_ and remote_ vars

This commit is contained in:
Jeremy Gardais 2019-10-05 20:05:14 +02:00
parent a123598f2a
commit 826bf47625
1 changed files with 12 additions and 7 deletions

View File

@ -1,10 +1,15 @@
#!/bin/sh #!/bin/sh
# Vars {{{ # Vars {{{
remote_dir="${HOME}/Nextcloud/games/linux.sgl.script" ## Steam {{{
steam_id="112595584"
steam_userdata=".steam/steam/userdata/${steam_id}"
## }}}
steam_id="1" remote_dir="${HOME}/Nextcloud/games/linux.sgl.script"
steam_userdata="${HOME}/.steam/steam/userdata/${steam_id}" remote_steam_userdata="${remote_dir}/${steam_userdata}"
local_steam_userdata="${HOME}/${steam_userdata}"
# }}} # }}}
# Tests {{{ # Tests {{{
@ -16,11 +21,11 @@ if [ ! -d "${remote_dir}" ]; then
fi fi
## }}} ## }}}
## Ensure Steam dir exist {{{ ## 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]?" 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 read -r create_local_steam_userdata
if [ "${create_steam_userdata}" = "" ] || [ "${create_steam_userdata}" = "Y" ] || [ "${create_steam_userdata}" = "y" ]; then if [ "${create_local_steam_userdata}" = "" ] || [ "${create_local_steam_userdata}" = "Y" ] || [ "${create_local_steam_userdata}" = "y" ]; then
mkdir -p -- "${steam_userdata}" mkdir -p -- "${local_steam_userdata}"
else else
printf '\e[1;35m%-6s\e[m\n' "Steam directory doesn't exists, abort script." printf '\e[1;35m%-6s\e[m\n' "Steam directory doesn't exists, abort script."
exit 2 exit 2