From 76c4ed5fca3d4edd32959693893049687f20a957 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 19 Feb 2017 11:14:55 +0100 Subject: [PATCH] [Done] Added machine_id asked to user + unlock code logged to ./server/created --- clone/clone | 6 ++++++ clone/clone.conf | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/clone/clone b/clone/clone index 4bf4c27..7ca1094 100755 --- a/clone/clone +++ b/clone/clone @@ -321,6 +321,9 @@ step9(){ echo -e "\n>>> [9] Set up SATS operating folder"; + # (0) Ask for machine id # + read -p " (?) Machine id : " MACHINE_ID; + test -n "$MACHINE_ID" || echo "Invalid machine name, aborting!" && exit; # (1) Create operating folder # echo " (.) Create operating folder"; @@ -337,6 +340,9 @@ step9(){ echo $MACHINE_ID | sudo tee /mnt/home/sats/satsd/conf/machine.id > /dev/null; echo "" | sudo tee /mnt/home/sats/satsd/conf/auth.list > /dev/null; echo "$MACHINE_SECRET:500:$NEXT_SECRET" | sudo tee /mnt/home/sats/satsd/conf/machine.secret > /dev/null; + echo "$UNLOCK_CODE" | sudo tee /mnt/home/sats/satsd/conf/machine.unlock > /dev/null; + + echo "$MACHINE_ID;$UNLOCK_CODE" | tee ./server/created > /dev/null; # (3) Set up SATS botting script # diff --git a/clone/clone.conf b/clone/clone.conf index 1cffa8b..72df6d5 100755 --- a/clone/clone.conf +++ b/clone/clone.conf @@ -13,9 +13,9 @@ export SERVER_HOSTNAME="xdrm.io"; export SERVER_USERNAME="satsd"; # DEFAULT SATS SETTINGS -export MACHINE_ID=$(date +%s); export MACHINE_BRANCH="1.0"; export MACHINE_STATE="STOP"; export API_URL="http://192.168.0.43/logauth/api/machineDefault/sync/"; export MACHINE_SECRET=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 250); -export NEXT _SECRET=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 250); +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 64);