tweaks
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Updating local packages..."
|
echo "Updating local packages..."
|
||||||
errors=`apt-add-repository universe >/dev/null 2>/dev/null && apt update >/dev/null 2>/dev/null`
|
errors=`apt-add-repository universe >/dev/null 2>/dev/null && apt update 2>&1 >/dev/null`
|
||||||
if [ "$?" = "0" ]; then
|
if [ "$?" = "0" ]; then
|
||||||
echo "Done."
|
echo "Done."
|
||||||
else
|
else
|
||||||
@@ -34,6 +34,7 @@ nicdevices=""; for nic in $(ip -o link show | awk -F': ' '{print $2}' | grep -v
|
|||||||
nics=`dialog --separate-output --no-cancel --no-items --title "Network devices for bridge" --checklist "Select the network devices to be bridged" $height $width ${window}$nicdevices 2>&1 1>/dev/tty`
|
nics=`dialog --separate-output --no-cancel --no-items --title "Network devices for bridge" --checklist "Select the network devices to be bridged" $height $width ${window}$nicdevices 2>&1 1>/dev/tty`
|
||||||
rootpassword=`dialog --no-cancel --title "Root password" --insecure --passwordbox "Enter root password" $height $width 2>&1 1>/dev/tty`
|
rootpassword=`dialog --no-cancel --title "Root password" --insecure --passwordbox "Enter root password" $height $width 2>&1 1>/dev/tty`
|
||||||
timezone=`dialog --no-cancel --title "Timezone" --inputbox "Enter time zone" $height $width "America/Los_Angeles" 2>&1 1>/dev/tty`
|
timezone=`dialog --no-cancel --title "Timezone" --inputbox "Enter time zone" $height $width "America/Los_Angeles" 2>&1 1>/dev/tty`
|
||||||
|
admin=""; while [ -z "$admin" ]; do admin=`dialog --no-cancel --inputbox "Admin account/first user (with sudo capability)" 8 100 2>&1 >/dev/tty`; done
|
||||||
|
|
||||||
for disk in `echo "$disks"`; do
|
for disk in `echo "$disks"`; do
|
||||||
echo ""
|
echo ""
|
||||||
@@ -161,8 +162,9 @@ echo "ln -s /proc/self/mounts /etc/mtab" >> /mnt/setup-chroot.sh
|
|||||||
echo "echo \"Done.\"" >> /mnt/setup-chroot.sh
|
echo "echo \"Done.\"" >> /mnt/setup-chroot.sh
|
||||||
echo "echo \"\"" >> /mnt/setup-chroot.sh
|
echo "echo \"\"" >> /mnt/setup-chroot.sh
|
||||||
echo "echo \"Updating apt repositories inside chroot...\"" >> /mnt/setup-chroot.sh
|
echo "echo \"Updating apt repositories inside chroot...\"" >> /mnt/setup-chroot.sh
|
||||||
echo "errors=`apt update 2>&1 1>/dev/null`" >> /mnt/setup-chroot.sh
|
echo "apt update" >> /mnt/setup-chroot.sh
|
||||||
echo "if ! [ \"\$?\" = \"0\" ]; then ">> /mnt/setup-chroot.sh
|
#echo "errors=`apt update 2>&1 1>/dev/null`" >> /mnt/setup-chroot.sh
|
||||||
|
echo 'if ! [ "$?" = "0" ]; then '>> /mnt/setup-chroot.sh
|
||||||
echo " echo \"Failed to update apt repositories inside chroot - \$errors\"" >> /mnt/setup-chroot.sh
|
echo " echo \"Failed to update apt repositories inside chroot - \$errors\"" >> /mnt/setup-chroot.sh
|
||||||
echo " exit 1">> /mnt/setup-chroot.sh
|
echo " exit 1">> /mnt/setup-chroot.sh
|
||||||
echo "fi">> /mnt/setup-chroot.sh
|
echo "fi">> /mnt/setup-chroot.sh
|
||||||
@@ -230,11 +232,12 @@ echo "systemctl enable ssh">> /mnt/setup-chroot.sh
|
|||||||
|
|
||||||
|
|
||||||
# create parker user automated way
|
# create parker user automated way
|
||||||
#zfs create rpool/home/YOURUSERNAME
|
echo "zfs create rpool/home/$admin" >> /mnt/setup-chroot.sh
|
||||||
# adduser YOURUSERNAME
|
echo "adduser $admin" >> /mnt/setup-chroot.sh
|
||||||
# cp -a /etc/skel/.[!.]* /home/YOURUSERNAME
|
echo "cp -a /etc/skel/.[!.]* /home/$admin" >> /mnt/setup-chroot.sh
|
||||||
# chown -R YOURUSERNAME:YOURUSERNAME /home/YOURUSERNAME
|
echo "chown -R ${admin}:${admin} /home/$admin" >> /mnt/setup-chroot.sh
|
||||||
# usermod -a -G adm,cdrom,dip,lpadmin,plugdev,sambashare,sudo YOURUSERNAME
|
echo "usermod -a -G adm,cdrom,dip,lpadmin,plugdev,sambashare,sudo $admin" >> /mnt/setup-chroot.sh
|
||||||
|
echo "echo '${admin}:${rootpassword}' | chpasswd" >> /mnt/setup-chroot.sh
|
||||||
|
|
||||||
#create swap space, too if necessary
|
#create swap space, too if necessary
|
||||||
|
|
||||||
@@ -252,7 +255,8 @@ echo "systemctl enable ssh">> /mnt/setup-chroot.sh
|
|||||||
|
|
||||||
chmod +x /mnt/setup-chroot.sh
|
chmod +x /mnt/setup-chroot.sh
|
||||||
echo "Done."
|
echo "Done."
|
||||||
chroot /mnt /setup-chroot.sh --login
|
chroot /mnt /setup-chroot.sh
|
||||||
|
#--login
|
||||||
|
|
||||||
#echo ""
|
#echo ""
|
||||||
#echo "Clearing chroot configuration script..."
|
#echo "Clearing chroot configuration script..."
|
||||||
|
|||||||
Reference in New Issue
Block a user