clemmy/creds.sh

26 lines
434 B
Bash
Raw Normal View History

2023-01-17 01:07:40 +11:00
if [ ! -f ~/.config/clemmy/accounts.csv ]; then
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
accsr=$(cat ~/.config/clemmy/accounts.csv)
2023-01-17 01:07:40 +11:00
i=0
for line in ${accsr[*]}; do
accs[$i]="$line"
2023-01-17 01:07:40 +11:00
i=$((i+1))
done
select_account()
{
IFS=, read INSTANCE TOKE INSEC <<< "${accs[$1]}"
}
select_account 0