switch ssb identity tool
This commit is contained in:
parent
de9fe7cf0f
commit
de9c623fc7
|
@ -1,9 +1,41 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
# Author: Fred (support@qo-op.com)
|
||||
# Version: 2020.03.21
|
||||
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
||||
########################################################################
|
||||
MY_PATH="`dirname \"$0\"`" # relative
|
||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||
ME="${0##*/}"
|
||||
echo '
|
||||
########################################################################
|
||||
# \\///
|
||||
# qo-op
|
||||
############# '$MY_PATH/$ME'
|
||||
########################################################################
|
||||
__ __ _
|
||||
(_ (_ |_) __ o _| _ ._ _|_ o _|_
|
||||
__) __) |_) | (_| (/_ | | |_ | |_ \/
|
||||
/ SWITCHing
|
||||
########################################################################
|
||||
'
|
||||
# Taking care of 1st backup and linking
|
||||
[ ! -L ~/.ssb ] && [ ! -d ~/.ssb_1st ] && echo "Making 1st backup" && mv ~/.ssb ~/.ssb_1st && ln -s ~/.ssb_1st ~/.ssb
|
||||
|
||||
# Choose Loop
|
||||
for dir in $(ls -d ~/.ssb* | cut -d '_' -f 2); do
|
||||
[ ! -e $dir ] && echo "Choose..." || continue
|
||||
echo " $dir Identity ? (y)/n" && read isok
|
||||
[ ! -e $dir ] && echo '
|
||||
__
|
||||
(_ _ _|_ _|_ | _ |_ _|_ _|_
|
||||
__) (_ |_| |_ |_ | (/_ |_) |_| |_ |_ ID
|
||||
|
||||
' || continue
|
||||
|
||||
echo "Do you want to become $dir Identity ? (y)/n" && read isok
|
||||
[[ "$isok" == "y" ]] && [ -L ~/.ssb ] && rm ~/.ssb && ln -s ~/.ssb_$dir ~/.ssb && echo "Welcome $dir" && break
|
||||
done
|
||||
echo "Your SSB Identity is linked to"
|
||||
|
||||
echo 'Your SSB Identity is now linked to'
|
||||
ls -l ~/.ssb
|
||||
[ ! -f ~/.ssb/secret.dunikey ] && [ -f $MY_PATH/secret2dunikey.sh ] && $MY_PATH/secret2dunikey.sh
|
||||
[ -f ~/.ssb/secret.dunikey ] && g1pub=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && echo "G1SSB Wallet pubkey : $g1pub"
|
||||
|
|
Loading…
Reference in New Issue