From 0781ec4ec352114ffba1508ce5cb69058f2fae75 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 23 Feb 2017 09:41:45 +0100 Subject: [PATCH] Added callback ip --- clone/clone | 5 +++++ clone/clone.conf | 8 ++++++-- clone/utility/sats-boot | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/clone/clone b/clone/clone index 00d9ff5..9b1efcc 100755 --- a/clone/clone +++ b/clone/clone @@ -265,8 +265,13 @@ step7(){ echo " - /lib/systemd/system"; sudo cp ./utility/sats-boot.service /mnt/lib/systemd/system/sats-boot.service; + echo " (.) Create sats-boot script"; sudo cp ./utility/sats-boot /mnt/home/pi/sats-boot; + + # If callback address for testing add it to sats-boot # + sudo cat ./utility/sats-boot | sed "s/#@@@@#/nc $CALLBACK < ifconfig;/" | sudo tee /mnt/home/pi/sats-boot; + sudo touch /mnt/home/pi/first_boot; sudo chown 1000:1000 /mnt/home/pi/sats-boot; sudo chown 1000:1000 /mnt/home/pi/first_boot; diff --git a/clone/clone.conf b/clone/clone.conf index e568f0a..72b8f98 100755 --- a/clone/clone.conf +++ b/clone/clone.conf @@ -22,6 +22,10 @@ export NEXT_SECRET=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 250); export UNLOCK_CODE=$(tr -dc a-f0-9 < /dev/urandom | head -c 128); export WAREHOUSE_TOKEN="52131065a906de90e26da0732e58400edd6739cfa03fc658e7593abef4a4504e18e66e1a8fe9da374a8e8f753603463e4777789262b3ee945d4bf72dd8d6399c"; -# IF RUN ON LOCAL -# will create an entry in /etc/hosts +# FOR TESTING ONLY - IF RUN ON LOCAL + +# will create an entry in /etc/hosts to user local SMMP export LOCAL_TEST="192.168.0.15 logauth"; + +# callback ip/port to send `ifconfig` content on first install +export CALLBACK="192.168.0.15 45678"; diff --git a/clone/utility/sats-boot b/clone/utility/sats-boot index 232edc3..95d9635 100644 --- a/clone/utility/sats-boot +++ b/clone/utility/sats-boot @@ -1,5 +1,7 @@ #!/bin/sh +#@@@@# + # [1] Set random passwords for 'sats' RANDOM_PASS=$(tr -cd A-Za-z0-9_ < /dev/urandom | head -c 256); echo "$RANDOM_PASS\n$RANDOM_PASS\n" | sudo passwd sats;