aboutsummaryrefslogtreecommitdiff
path: root/operators/command_authorize.zsh
blob: 6876a2116d0340ab1a9a0d5462f191ca9977d318 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Copyright (C) 2024-2026 Maria Lisina
# Copyright (C) 2024-2026 Danil Lisin
# SPDX-License-Identifier: Apache-2.0

command_authorize=0

if [[ -n "${1}" ]]
then
    ib_board="${1}"
    source "${units}/ib_config.zsh"
    source "${units}/ib_authconfig.zsh"

    if [[ -z "${ib_auth}" ]]
    then
        output_text="Unsupported Image Board"
        return
    fi

    shift
else
    output_text="You must specify Image Board"
    return
fi

if [[ -n "${1}" ]]
then
    ib_login="${1}"
    shift
fi

if [[ -n "${1}" ]]
then
    ib_key="${1}"
    shift
fi

source "${units}/ib_lock.zsh"

if [[ -z "${output_text}" ]]
then
    output_text="Authorized successfully"
fi