diff --git a/clone/clone b/clone/clone index a11c882..1f207ea 100755 --- a/clone/clone +++ b/clone/clone @@ -249,11 +249,7 @@ step7(){ sudo cp ./utility/sats-boot.service /mnt/lib/systemd/system/sats-boot.service; echo " (.) Create sats-boot script"; - 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 cp ./utility/sats-boot /mnt/home/pi/sats-boot; sudo chown 1000:1000 /mnt/home/pi/sats-boot; sudo chmod 770 /mnt/home/pi/sats-boot; @@ -278,8 +274,16 @@ step7(){ step8(){ echo -e "\n>>> [8] Set up WiFi configuration"; + + # (1) Update interfaces configuration # + echo " (.) Update /etc/network/interfaces configuration"; + cat ./utility/interfaces | sudo tee /mnt/etc/network/interfaces > /dev/null; + + # (2) Set up wifi credentials # + echo " (.) Set up WiFi credentials"; echo -e "network={\n\tssid=\"$WIFI_SSID\"\n\tpsk=\"$WIFI_PASS\"\n}" | sudo tee -a /mnt/etc/wpa_supplicant/wpa_supplicant.conf > /dev/null; + echo "<<< done"; step9; diff --git a/clone/utility/interfaces b/clone/utility/interfaces new file mode 100644 index 0000000..269958b --- /dev/null +++ b/clone/utility/interfaces @@ -0,0 +1,20 @@ +# interfaces(5) file used by ifup(8) and ifdown(8) + +# Please note that this file is written to be used with dhcpcd +# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf' + +# Include files from /etc/network/interfaces.d: +source-directory /etc/network/interfaces.d + +# local loop +auto lo +iface lo inet loopback + +# ethernet network interface +iface eth0 inet manual + +# wifi network interface #1 +allow-hotplug wlan0 +iface wlan0 inet manual + wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf + up /bin/sh /home/sats/satsd/sats-loop update; diff --git a/clone/utility/sats-boot b/clone/utility/sats-boot index fd629ec..6a42be9 100644 --- a/clone/utility/sats-boot +++ b/clone/utility/sats-boot @@ -12,4 +12,4 @@ echo "$RANDOM_PASS\n$RANDOM_PASS\n" | sudo passwd pi; sudo systemctl start ssh; # [4] Try to install necessary packages -sudo apt-get -y install git php5 php5-cli; +sudo apt-get -y install git php5 php5-cli php-curl; diff --git a/clone/utility/sats-boot_withoutlock b/clone/utility/sats-boot_withoutlock deleted file mode 100644 index 7c8a704..0000000 --- a/clone/utility/sats-boot_withoutlock +++ /dev/null @@ -1,15 +0,0 @@ -#!/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 -y install git; diff --git a/clone/utility/sats-loop b/clone/utility/sats-loop index f06ecf4..2446315 100644 --- a/clone/utility/sats-loop +++ b/clone/utility/sats-loop @@ -9,7 +9,7 @@ sh /home/sats/satsd/install-source; # [2] Propagate script if [ "$1" = "daemon" ]; then - sh /home/sats/satsd/source/daemon $* 2>> /home/sats/satsd/log/daemon.log >> /home/sats/satsd/log/daemon.log; + sh /home/sats/satsd/source/daemon 2>> /home/sats/satsd/log/daemon.log >> /home/sats/satsd/log/daemon.log; elif [ "$1" = "update" ]; then