This commit is contained in:
xdrm-brackets 2017-05-09 17:23:37 +02:00
parent d4c88bb918
commit d5ec68c25b
1 changed files with 4 additions and 2 deletions

View File

@ -408,16 +408,18 @@ step9(){
# [10] Umount device and share data to server # [10] Umount device and share data to server
#========================================================# #========================================================#
step10(){ step10(){
echo "\n>>> Finishing properly"; echo -e "\n>>> Finishing properly";
echo " (.) Copying SATS public key to server's authorized_keys"; echo " (.) Copying SATS public key to server's authorized_keys";
cat ./server/authorized_keys | tail -n 1 | ssh smmp-server "cat >> ~/authorized_keys" || echo " (!) Cannot share public key"; cat ./server/authorized_keys | tail -n 1 | ssh smmp-server "cat >> ~/.ssh/authorized_keys" || echo " (!) Cannot share public key";
echo " (.) Copying SATS unlock code to server's database"; echo " (.) Copying SATS unlock code to server's database";
DB_PASS="e6mmCpx9Oks5BwS1rcPIrgRDIGLrmDQn9oqX0tqF2VhyiLDW6yKJFrafewwCZ63njYaDKiNjiAS11hrLYij7HaxTdHb33tEqby34vgVrUYaUnwPnCJHmkoyR3TfjcZNCPti8VZG0Oooq7qSHy4lcD6T4EFCcOQ_yHjVIfibvbuZqQcPTUvbDP_9910mRDBUADShIe4sjK2FLOTCz6usUKkNqTH3PldRfAgGl182Zw9tiSPJfvQZX3S2bKblNuZf1"; DB_PASS="e6mmCpx9Oks5BwS1rcPIrgRDIGLrmDQn9oqX0tqF2VhyiLDW6yKJFrafewwCZ63njYaDKiNjiAS11hrLYij7HaxTdHb33tEqby34vgVrUYaUnwPnCJHmkoyR3TfjcZNCPti8VZG0Oooq7qSHy4lcD6T4EFCcOQ_yHjVIfibvbuZqQcPTUvbDP_9910mRDBUADShIe4sjK2FLOTCz6usUKkNqTH3PldRfAgGl182Zw9tiSPJfvQZX3S2bKblNuZf1";
DB_USER="sats-set-unlock"; DB_USER="sats-set-unlock";
DB_DATABASE="logauth"; DB_DATABASE="logauth";
ssh smmp-server "echo \"UPDATE machine SET unlock_code='$UNLOCK_CODE' WHERE id_machine = $MACHINE_ID;\" | mysql -u$DB_USER -p$DB_PASS --database=$DB_DATABASE" || echo " (!) Cannot share unlock code"; ssh smmp-server "echo \"UPDATE machine SET unlock_code='$UNLOCK_CODE' WHERE id_machine = $MACHINE_ID;\" | mysql -u$DB_USER -p$DB_PASS --database=$DB_DATABASE" || echo " (!) Cannot share unlock code";
# and locally for testing purpose
echo "UPDATE machine SET unlock_code='$UNLOCK_CODE' WHERE id_machine = $MACHINE_ID;" | mysql -u$DB_USER -p$DB_PASS --database=$DB_DATABASE || echo " (!) Cannot share unlock code";
echo " (.) Unmounting remote device"; echo " (.) Unmounting remote device";
sudo umount /mnt; sudo umount /mnt;