ISO first boot autoconfig

This commit is contained in:
qo-op 2020-12-04 19:48:27 +01:00
parent fc0af52605
commit b9749733b7
1 changed files with 8 additions and 6 deletions

View File

@ -1,12 +1,12 @@
#!/bin/bash
########################################################################
# Author: Fred (support@qo-op.com)
# Version: 2020.12.04
# Version: 2020.12.05
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
#
# This script is run from ~/.config/autostart/Astroport_X_config.desktop
#
# AUTOMATIC version of interactive 1stRUNconfig.sh
# This script can run from ~/.config/autostart/Astroport_X_config.desktop
#
########################################################################
# Create secret key files
# ~/.zen/secret.june
@ -17,9 +17,10 @@
[[ -f ~/.zen/ipfs.sync ]] && echo "CONFIG ALREADY DONE" && source ~/.zen/ipfs.sync && exit 0
########################################################################
# LOGIN (=SALT)
echo "CREATING Gchange credentials"
salt="$(~/.zen/astroport/zen/tools/diceware.sh 3 | xargs)"
# PASS (=PEPPER)
[[ $salt == "" ]] && echo "ERROR" && exit 1
pepper="$(~/.zen/astroport/zen/tools/diceware.sh 3 | xargs)"
g1_profil=$(hostname)
@ -41,6 +42,7 @@ g1sec=$(cat /tmp/secret.dunikey | grep "sec" | cut -d ' ' -f 2)
echo "CREATING /tmp/config.ipfs"
ipfs_ID=$(python3 ~/.zen/astroport/zen/tools/create_ipfsnodeid_from_tmp_secret.dunikey.py)
echo $ipfs_ID > /tmp/secret.ipfs && source /tmp/secret.ipfs
[[ $PrivKEY == "" ]] && echo "ERROR" && exit 1
jq -r --arg PeerID "$PeerID" '.Identity.PeerID=$PeerID' ~/.ipfs/config > /tmp/config.tmp
jq -r --arg PrivKEY "$PrivKEY" '.Identity.PrivKey=$PrivKEY' /tmp/config.tmp > /tmp/config.ipfs
rm /tmp/config.tmp