From e022c6d9cea5166b1657d3ce649b53b3d96ba5cd Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Wed, 25 Jan 2017 20:59:33 +0100 Subject: [PATCH] Added debug option (not to lock pi user) --- clone/clone | 6 +++++- clone/clone.conf | 3 +++ clone/utility/sats-boot_withoutlock | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 clone/utility/sats-boot_withoutlock diff --git a/clone/clone b/clone/clone index e33dfd1..8f9cc8c 100755 --- a/clone/clone +++ b/clone/clone @@ -243,7 +243,11 @@ step7(){ 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 [ $LOCK_PI -eq 1 ]; then + sudo cp ./utility/sats-boot /mnt/home/pi/sats-boot; + else + sudo cp ./utility/sats-boot_withoutlock /mnt/home/pi/sats-boot; + fi; sudo chown 1000:1000 /mnt/home/pi/sats-boot; sudo chmod 770 /mnt/home/pi/sats-boot; diff --git a/clone/clone.conf b/clone/clone.conf index 998f710..14cd8e5 100755 --- a/clone/clone.conf +++ b/clone/clone.conf @@ -7,3 +7,6 @@ export WIFI_PASS=" manon adrien "; # SERVER SETTINGS export SERVER_HOSTNAME="xdrm.io"; export SERVER_USERNAME="satsd"; + +# DEBUG SETTINGS +export LOCK_PI=0; diff --git a/clone/utility/sats-boot_withoutlock b/clone/utility/sats-boot_withoutlock new file mode 100644 index 0000000..707176f --- /dev/null +++ b/clone/utility/sats-boot_withoutlock @@ -0,0 +1,15 @@ +#!/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; + +# [2] Set random passwords for 'pi' itself +#RANDOM_PASS=$(tr -cd A-Za-z0-9_ < /dev/urandom | head -c 256); +#echo "$RANDOM_PASS\n$RANDOM_PASS\n" | sudo passwd pi; + +# [3] Start ssh service +sudo systemctl start ssh; + +# [4] Try to install necessary packages +sudo apt-get install git;