This commit is contained in:
xdrm-brackets 2017-01-20 11:52:48 +01:00
parent 0afed12025
commit 76152cd72d
1 changed files with 21 additions and 7 deletions

View File

@ -37,12 +37,13 @@ echo "\n>>> [3] Formatting disk";
# (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;
( test -z "$confirm_format" || test $confirm_format != "y" ) \ test -z "$confirm_format" && echo "<<< aborting" && exit;
&& (echo "<<< aborting" && exit); test $confirm_format != "y" && echo "<<< aborting" && exit;
# (2) Init gpt entry # # (2) Init gpt entry #
echo " ))) replace by real code ((("; # echo " ))) replace by real code (((";
# echo -e "g\nw" | fdisk $1";
echo -e "g\nw" | sudo fdisk $1;
@ -52,8 +53,8 @@ echo "\n>>> [4] Burning image into disk";
# (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;
( test -z "$confirm_burn" || test $confirm_burn != "y" ) \ test -z "$confirm_burn" && echo "<<< aborting" && exit;
&& (echo "<<< aborting" && exit); test $confirm_burn != "y" && echo "<<< aborting" && exit;
# (2) Burning image into disk # # (2) Burning image into disk #
sudo dd if=./original.img of=$1 bs=4M \ sudo dd if=./original.img of=$1 bs=4M \
@ -68,7 +69,7 @@ exit;
# [5] Mount partition # [5] Mount partition
#========================================================# #========================================================#
echo ">>> [5] Mounting partition ${1}2"; echo "\n>>> [5] Mounting partition ${1}2";
# [1] Mount device partition # [1] Mount device partition
sudo mount ${1}2 /mnt -o uid=$UID,gid=$GID,umask=022; sudo mount ${1}2 /mnt -o uid=$UID,gid=$GID,umask=022;
@ -76,6 +77,19 @@ sudo mount ${1}2 /mnt -o uid=$UID,gid=$GID,umask=022;
echo "<<< done"; echo "<<< done";
# [6] Updating users & groups
#========================================================#
echo "\n>>> [6] Updating users & groups";
echo " (.) Adding user satsuser";
sudo echo "satsuser:{somedigestedpass}:17185:0:999999:7::" >> /mnt/etc/shadow;
sudo echo "satsuser:{somedigestedpass}:17185:0:999999:7::" >> /mnt/etc/shadow-;
echo " (.) Adding group ssh-key";
# [4] Manage SSH keys # # [4] Manage SSH keys #
######################################## ########################################