This commit is contained in:
qo-op 2020-04-30 04:50:03 +02:00
parent ddfb39274b
commit 07e992474d
1 changed files with 17 additions and 24 deletions

View File

@ -43,34 +43,27 @@ if [[ ! $(which sbotc) ]]; then
cd $MY_PATH
fi
if [[ -d ~/.ssb ]]; then
echo "ScuttleButt is already installed...??"
echo "Do you want to create a new ~/.ssb identity (will backup current one) ? (y)/n"
read isitok
if [[ "$isitok" == "y" ]]; then
echo "Do you want to create a new ~/.ssb identity (will backup current one) ? (y)/n"
read isitok
if [[ "$isitok" == "y" ]]; then
# TEST ssb-server Install
ssbSERVER=$(which ssb-server)
# TEST ssb-server Install
ssbSERVER=$(which ssb-server)
# If exists backup ~/.ssb to ~/.ssb_$USER SSB (one time only !)
[[ -d ~/.ssb_$USER ]] && echo "BACKUP already existing... ~/.ssb_$USER !!! Manual check please..." && exit 1
# If exists backup ~/.ssb to ~/.ssb_$USER SSB (one time only !)
[[ -d ~/.ssb_$USER ]] && echo "BACKUP already existing... ~/.ssb_$USER !!! Manual check please..." && exit 1
[[ -d ~/.ssb ]] && [[ ! -d ~/.ssb_$USER ]] && mv ~/.ssb ~/.ssb_$USER
# [[ $ssbSERVER == "" ]] && echo "Check your ssb-server install... Cannot find it !!" && exit 1 \
# || kill -9 $(ps auxf --sort=+utime | grep -w ssb-server| grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}')
# CREATE ~/.ssb_astroport
[[ ! -d ~/.ssb_astroport ]] && mkdir -p ~/.ssb_astroport
[[ -d ~/.ssb ]] && [[ ! -d ~/.ssb_$USER ]] && mv ~/.ssb ~/.ssb_$USER
# CREATE ~/.ssb_astroport
[[ ! -d ~/.ssb_astroport ]] && mkdir -p ~/.ssb_astroport
# Symlink ~/.ssb -> ~/.ssb_astroport
[[ -L ~/.ssb ]] && rm ~/.ssb
[[ -d ~/.ssb_astroport ]] && ln -s ~/.ssb_astroport ~/.ssb
# Symlink ~/.ssb -> ~/.ssb_astroport
[[ -L ~/.ssb ]] && rm ~/.ssb
[[ -d ~/.ssb_astroport ]] && ln -s ~/.ssb_astroport ~/.ssb
else
echo "You must remove old '~/.ssb' before running $ME";
exit 1;
fi
else
echo "You must remove old '~/.ssb' before running $ME";
exit 1;
fi
cd ~/.ssb/
@ -111,7 +104,7 @@ fi
# CREATE ~/.ssb/secret.dunikey
python3 $MY_PATH/key_create_dunikey.py "$salt" "$pepper"
sleep 2
[[ -f /tmp/secret.dunikey ]] && mv /tmp/secret.dunikey ~/.ssb/ || exit 1
[[ -f /tmp/secret.dunikey ]] && mv /tmp/secret.dunikey ~/.ssb/secret.dunikey || exit 1
# CREATE SSB secret
g1pub=$(cat ~/.ssb/secret.dunikey | grep "pub" | cut -d ' ' -f 2)