[Done] Added machine_id asked to user + unlock code logged to ./server/created

This commit is contained in:
xdrm-brackets 2017-02-19 11:14:55 +01:00
parent 8fb77494df
commit 76c4ed5fca
2 changed files with 8 additions and 2 deletions

View File

@ -321,6 +321,9 @@ step9(){
echo -e "\n>>> [9] Set up SATS operating folder"; 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 # # (1) Create operating folder #
echo " (.) 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 $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 "" | 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 "$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 # # (3) Set up SATS botting script #

View File

@ -13,9 +13,9 @@ export SERVER_HOSTNAME="xdrm.io";
export SERVER_USERNAME="satsd"; export SERVER_USERNAME="satsd";
# DEFAULT SATS SETTINGS # DEFAULT SATS SETTINGS
export MACHINE_ID=$(date +%s);
export MACHINE_BRANCH="1.0"; export MACHINE_BRANCH="1.0";
export MACHINE_STATE="STOP"; export MACHINE_STATE="STOP";
export API_URL="http://192.168.0.43/logauth/api/machineDefault/sync/"; 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 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);