diff options
| -rw-r--r-- | operators/command_source.zsh | 13 | ||||
| -rw-r--r-- | units/ib_config.zsh | 7 | ||||
| -rw-r--r-- | units/sn_auth.zsh | 4 |
3 files changed, 20 insertions, 4 deletions
diff --git a/operators/command_source.zsh b/operators/command_source.zsh index 26a60fd..edd0d39 100644 --- a/operators/command_source.zsh +++ b/operators/command_source.zsh @@ -12,6 +12,19 @@ do sleep 1 done +if ! [[ -f "${user_config}/saucenao" ]] +then + user_id=0 + user_config="${users}/${user_id}" +fi + +rmdir "${user_config}.lock" + +until mkdir "${user_config}.lock" +do + sleep 1 +done + source "${units}/sn_auth.zsh" if [[ -d "${user_config}" ]] diff --git a/units/ib_config.zsh b/units/ib_config.zsh index fc03005..e107f3f 100644 --- a/units/ib_config.zsh +++ b/units/ib_config.zsh @@ -20,6 +20,11 @@ esac auth_dir="${user_config}/${ib_config}" +until mkdir "${user_config}.lock" +do + sleep 1 +done + if ! [[ -d "${auth_dir}" || -z "${ib_mode}" ]] then user_id=0 @@ -27,6 +32,8 @@ then auth_dir="${user_config}/${ib_config}" fi +rmdir "${user_config}.lock" + timestamp_file="${auth_dir}/timestamp" token_file="${auth_dir}/token" login_file="${auth_dir}/${ib_login_file}" diff --git a/units/sn_auth.zsh b/units/sn_auth.zsh index f761b86..05e4fce 100644 --- a/units/sn_auth.zsh +++ b/units/sn_auth.zsh @@ -9,10 +9,6 @@ elif [[ -f "${user_config}/saucenao" ]] then sn_key="$(< "${user_config}/saucenao")" return -elif [[ -f "${users}/0/saucenao" ]] -then - sn_key="$(< "${users}/0/saucenao")" - return else output_text="You must provide your SauceNAO API key before you can use SauceNAO" return |
