Move changing to BASH to armbian-config (#2694)

This prevents unwanted automated switching back to bash on upgrade
This commit is contained in:
Igor Pečovnik 2021-03-07 16:06:34 +01:00 committed by GitHub
parent a3d29f4082
commit eb2060ab46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -596,18 +596,6 @@ compile_armbian-zsh()
exit 0
END
# set up post remove script
cat <<-END > "${tmp_dir}/${armbian_zsh_dir}"/DEBIAN/postrm
#!/bin/sh
# change shell back to bash for future users
BASHLOCATION=\$(grep /bash\$ /etc/shells | tail -1)
sed -i "s|^SHELL=.*|SHELL=\${BASHLOCATION}|" /etc/default/useradd
sed -i "s|^DSHELL=.*|DSHELL=\${BASHLOCATION}|" /etc/adduser.conf
# change to BASH shell for root and all normal users
awk -F'[/:]' '{if (\$3 >= 1000 && \$3 != 65534 || \$3 == 0) print \$1}' /etc/passwd | xargs -L1 chsh -s \$(grep /bash\$ /etc/shells | tail -1)
exit 0
END
cp -R "${SRC}"/cache/sources/oh-my-zsh "${tmp_dir}/${armbian_zsh_dir}"/etc/
cp -R "${SRC}"/cache/sources/evalcache "${tmp_dir}/${armbian_zsh_dir}"/etc/oh-my-zsh/plugins
cp "${tmp_dir}/${armbian_zsh_dir}"/etc/oh-my-zsh/templates/zshrc.zsh-template "${tmp_dir}/${armbian_zsh_dir}"/etc/skel/.zshrc