Skip to content

Commit

Permalink
Merge pull request #224 from lncm/seed-bootstrapping
Browse files Browse the repository at this point in the history
Add in a routine to pre-generate a seed in the image with createwallet
  • Loading branch information
nolim1t committed Jun 8, 2019
2 parents 84db650 + e741641 commit 8ff5ce7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ machine-id
# Automatic bootstrap files. For bootstrapping a wpa_supplicant and authorized_keys so that we don't have to keep doing it.
/wpa_supplicant.automatic.conf
/authorized_keys.automatic
# For importing seeds
/seed.automatic.txt

# For importing seeds (don't commit these)
home/lncm/seed.txt

alpine-rpi-*-armhf.tar.gz
Expand Down
12 changes: 12 additions & 0 deletions make_img.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ if [ -f ./authorized_keys.automatic ]; then
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' ./etc/ssh/sshd_config
fi

echo 'Check for seed'
if [ -f ./seed.automatic.txt ]; then
echo "Seed file exists, boostrapping the seed into the installation"
cp ./seed.automatic.txt ./home/lncm/seed.txt
fi

echo 'Generate fresh box.apkovl.tar.gz from source'
sh make_apkovl.sh
# Cleanup files we created
Expand All @@ -91,6 +97,12 @@ if [ -d ./home/lncm/.ssh ]; then
rm -fr ./home/lncm/.ssh
fi

# Cleanup seed from home/lncm
if [ -f ./home/lncm/seed.txt ]; then
echo "Remove seed.txt from installation so everything is equal to last commit"
rm ./home/lncm/seed.txt
fi

if [ -f ./etc/ssh/sshd_config.bak ]; then
echo "Restoring sshd_config to be equal with last commit"
cp ./etc/ssh/sshd_config.bak ./etc/ssh/sshd_config
Expand Down

0 comments on commit 8ff5ce7

Please sign in to comment.