minfix
This commit is contained in:
parent
de311713a4
commit
798f1dd040
25
clone/clone
25
clone/clone
|
@ -39,7 +39,7 @@ DEV="$1";
|
||||||
# [1] Init device layout (gpt table)
|
# [1] Init device layout (gpt table)
|
||||||
#========================================================#
|
#========================================================#
|
||||||
step1(){
|
step1(){
|
||||||
echo "\n>>> [1] Checking for mounted partitions ($DEV)";
|
echo -e "\n>>> [1] Checking for mounted partitions ($DEV)";
|
||||||
|
|
||||||
# (1) List partitions of this device #
|
# (1) List partitions of this device #
|
||||||
mounted_partitions=$( cat /proc/mounts | awk '{print $1}' | grep "$DEV" );
|
mounted_partitions=$( cat /proc/mounts | awk '{print $1}' | grep "$DEV" );
|
||||||
|
@ -66,7 +66,7 @@ step1(){
|
||||||
# [2] Initialize GTP Table
|
# [2] Initialize GTP Table
|
||||||
#========================================================#
|
#========================================================#
|
||||||
step2(){
|
step2(){
|
||||||
echo "\n>>> [2] Formatting disk ($DEV)";
|
echo -e "\n>>> [2] Formatting disk ($DEV)";
|
||||||
|
|
||||||
# (1) Confirmation #
|
# (1) Confirmation #
|
||||||
read -p" (!) Erase the whole disk ? it is irreversible! (y/n) [n]" confirm_format;
|
read -p" (!) Erase the whole disk ? it is irreversible! (y/n) [n]" confirm_format;
|
||||||
|
@ -90,7 +90,7 @@ step2(){
|
||||||
# [3] Burn image to device
|
# [3] Burn image to device
|
||||||
#========================================================#
|
#========================================================#
|
||||||
step3(){
|
step3(){
|
||||||
echo "\n>>> [3] Burning image into disk ($DEV)";
|
echo -e "\n>>> [3] Burning image into disk ($DEV)";
|
||||||
|
|
||||||
# (1) Confirmation #
|
# (1) Confirmation #
|
||||||
read -p" (!) Burn the whole disk ? it is irreversible! (y/n) [n]" confirm_burn;
|
read -p" (!) Burn the whole disk ? it is irreversible! (y/n) [n]" confirm_burn;
|
||||||
|
@ -114,7 +114,7 @@ step3(){
|
||||||
# [4] Mount partition
|
# [4] Mount partition
|
||||||
#========================================================#
|
#========================================================#
|
||||||
step4(){
|
step4(){
|
||||||
echo "\n>>> [4] Mounting partition ${DEV}2";
|
echo -e "\n>>> [4] Mounting partition ${DEV}2";
|
||||||
|
|
||||||
# [1] Mount device partition
|
# [1] Mount device partition
|
||||||
sudo mount ${DEV}2 /mnt || $( echo "<<< error: can't mount" && exit );
|
sudo mount ${DEV}2 /mnt || $( echo "<<< error: can't mount" && exit );
|
||||||
|
@ -132,7 +132,7 @@ step4(){
|
||||||
# [5] Updating users
|
# [5] Updating users
|
||||||
#========================================================#
|
#========================================================#
|
||||||
step5(){
|
step5(){
|
||||||
echo "\n>>> [5] Updating users' structure";
|
echo -e "\n>>> [5] Updating users' structure";
|
||||||
|
|
||||||
# (1) emulate `useradd sats` #
|
# (1) emulate `useradd sats` #
|
||||||
echo " (.) emulate \`useradd sats\`";
|
echo " (.) emulate \`useradd sats\`";
|
||||||
|
@ -167,7 +167,7 @@ step5(){
|
||||||
# [6] Manage SSH keys #
|
# [6] Manage SSH keys #
|
||||||
#========================================================#
|
#========================================================#
|
||||||
step6(){
|
step6(){
|
||||||
echo "\n>>> [6] Manage ssh keys";
|
echo -e "\n>>> [6] Manage ssh keys";
|
||||||
|
|
||||||
# (1) Create ssh key pair #
|
# (1) Create ssh key pair #
|
||||||
echo " (.) Create ssh key [ecdsa:521]";
|
echo " (.) Create ssh key [ecdsa:521]";
|
||||||
|
@ -225,7 +225,7 @@ step6(){
|
||||||
# [7] Set up systemd services
|
# [7] Set up systemd services
|
||||||
#========================================================#
|
#========================================================#
|
||||||
step7(){
|
step7(){
|
||||||
echo "\n>>> [7] Set up systemd background";
|
echo -e "\n>>> [7] Set up systemd background";
|
||||||
|
|
||||||
|
|
||||||
# (1) Create link in order to be handled #
|
# (1) Create link in order to be handled #
|
||||||
|
@ -266,12 +266,9 @@ step7(){
|
||||||
# [8] Manage Network config
|
# [8] Manage Network config
|
||||||
#========================================================#
|
#========================================================#
|
||||||
step8(){
|
step8(){
|
||||||
echo "\n>>> [8] Set up WiFi configuration";
|
echo -e "\n>>> [8] Set up WiFi configuration";
|
||||||
|
|
||||||
echo $WIFI_SSID;
|
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 "network={\n\tssid=\"${WIFI_SSID}\"\n\tpsk=\"$WIFI_PASS\"\n}";
|
|
||||||
exit;
|
|
||||||
echo "network={\n\tssid=\"$WIFI_SSID\"\n\tpsk=\"$WIFI_PASS\"\n}" | sudo tee -a /mnt/etc/wpa_supplicant/wpa_supplicant.conf > /dev/null;
|
|
||||||
|
|
||||||
echo "<<< done";
|
echo "<<< done";
|
||||||
|
|
||||||
|
@ -287,7 +284,7 @@ step8(){
|
||||||
#========================================================#
|
#========================================================#
|
||||||
step9(){
|
step9(){
|
||||||
|
|
||||||
echo "\n>>> [9] Set up SATS operating folder";
|
echo -e "\n>>> [9] Set up SATS operating folder";
|
||||||
|
|
||||||
|
|
||||||
# (1) Create operating folder #
|
# (1) Create operating folder #
|
||||||
|
@ -344,7 +341,7 @@ step10(){
|
||||||
|
|
||||||
# [0] Step choice
|
# [0] Step choice
|
||||||
#========================================================#
|
#========================================================#
|
||||||
echo "\nSTEPS";
|
echo -e "\nSTEPS";
|
||||||
echo "(1) Unmount mounted partitions";
|
echo "(1) Unmount mounted partitions";
|
||||||
echo "(2) Format disk (gpt table)";
|
echo "(2) Format disk (gpt table)";
|
||||||
echo "(3) Burn image into disk";
|
echo "(3) Burn image into disk";
|
||||||
|
|
Loading…
Reference in New Issue