2023-01-17 01:07:40 +11:00
|
|
|
if [ ! -f ~/.config/clemmy/accounts.csv ]; then
|
2023-01-17 03:36:47 +11:00
|
|
|
mkdir -p ~/.config/clemmy
|
2023-01-17 01:07:40 +11:00
|
|
|
touch ~/.config/clemmy/accounts.csv
|
|
|
|
echo "Do you already have an account? y/n"
|
|
|
|
read choice
|
|
|
|
if [ $choice == n ]; then
|
|
|
|
register
|
|
|
|
else
|
|
|
|
login
|
|
|
|
fi
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2023-11-26 17:45:42 +11:00
|
|
|
touch ~/.config/clemmy/default_account
|
|
|
|
|
2023-06-19 00:47:48 +10:00
|
|
|
accsr=$(cat ~/.config/clemmy/accounts.csv)
|
2023-01-17 01:07:40 +11:00
|
|
|
i=0
|
2023-06-19 00:47:48 +10:00
|
|
|
for line in ${accsr[*]}; do
|
|
|
|
accs[$i]="$line"
|
2023-01-17 01:07:40 +11:00
|
|
|
i=$((i+1))
|
|
|
|
done
|
2023-06-19 00:47:48 +10:00
|
|
|
|
2023-11-26 17:45:42 +11:00
|
|
|
select_account(){ IFS=, read INSTANCE TOKE INSEC <<< "${accs[$1]}"; }
|
|
|
|
defaultacc(){ echo -n $1 > ~/.config/clemmy/default_account; }
|
2023-06-19 00:47:48 +10:00
|
|
|
|
2023-11-26 17:45:42 +11:00
|
|
|
select_account $(cat ~/.config/clemmy/default_account)
|