commit 7fb0c618916e24a050481d5a15c58fdfc6dfa9f5
parent cb63fac1c8ad3fe9f1f1470d6754b5ff57d90703
Author: awy <awy@tutamail.com>
Date: Wed, 21 Aug 2024 14:06:14 +0300
tidy
Diffstat:
1 file changed, 20 insertions(+), 21 deletions(-)
diff --git a/post_chroot.sh b/post_chroot.sh
@@ -52,7 +52,26 @@ else
exit 1
fi
-useradd -m -g users -G wheel,storage,power -s /bin/bash $_username
+# use dash as sh
+pacman -Sy dash
+ln -sfT dash /usr/bin/sh
+mkdir -p /etc/pacman.d/hooks
+cat <<EOL >> /etc/pacman.d/hooks/bash.hook
+[Trigger]
+Type = Package
+Operation = Install
+Operation = Upgrade
+Target = bash
+
+[Action]
+Description = Re-pointing /bin/sh symlink to dash...
+When = PostTransaction
+Exec = /usr/bin/ln -sfT dash /usr/bin/sh
+Depends = dash
+EOL
+
+pacman -Sy zsh
+useradd -m -g users -G wheel,storage,power -s /bin/zsh $_username
echo root:$_rootpasswd | chpasswd
echo $_username:$_userpasswd | chpasswd
@@ -79,24 +98,4 @@ if [ "$_kernelflag" -eq 1 ]; then
grub-mkconfig -o /boot/grub/grub.cfg
fi
-# use dash as sh
-pacman -Sy dash zsh
-ln -sfT dash /usr/bin/sh
-mkdir -p /etc/pacman.d/hooks
-cat <<EOL >> /etc/pacman.d/hooks/bash.hook
-[Trigger]
-Type = Package
-Operation = Install
-Operation = Upgrade
-Target = bash
-
-[Action]
-Description = Re-pointing /bin/sh symlink to dash...
-When = PostTransaction
-Exec = /usr/bin/ln -sfT dash /usr/bin/sh
-Depends = dash
-EOL
-
-chsh -s /bin/zsh $_username
-
rm /post_chroot.sh