Swap spaces for tabs to match other files

merge-requests/16/head
g0t mi1k 4 years ago
parent 71f3cbaef4
commit c6b70bf355

@ -8,65 +8,65 @@
# and in the live-build configuration). # and in the live-build configuration).
configure_sources_list() { configure_sources_list() {
if grep -q '^deb ' /etc/apt/sources.list; then if grep -q '^deb ' /etc/apt/sources.list; then
echo "INFO: sources.list is configured, everything is fine" echo "INFO: sources.list is configured, everything is fine"
return return
fi fi
echo "INFO: sources.list is empty, setting up a default one for Kali" echo "INFO: sources.list is empty, setting up a default one for Kali"
cat >/etc/apt/sources.list <<END cat >/etc/apt/sources.list <<END
# See https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/ # See https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/
deb http://http.kali.org/kali kali-rolling main contrib non-free deb http://http.kali.org/kali kali-rolling main contrib non-free
# Additional line for source packages # Additional line for source packages
# deb-src http://http.kali.org/kali kali-rolling main contrib non-free # deb-src http://http.kali.org/kali kali-rolling main contrib non-free
END END
apt-get update apt-get update
} }
get_user_list() { get_user_list() {
for user in $(cd /home && ls); do for user in $(cd /home && ls); do
if ! getent passwd "$user" >/dev/null; then if ! getent passwd "$user" >/dev/null; then
echo "WARNING: user '$user' is invalid but /home/$user exists" echo "WARNING: user '$user' is invalid but /home/$user exists"
continue continue
fi fi
echo "$user" echo "$user"
done done
echo "root" echo "root"
} }
configure_zsh() { configure_zsh() {
if grep -q 'nozsh' /proc/cmdline; then if grep -q 'nozsh' /proc/cmdline; then
echo "INFO: user opted out of zsh by default" echo "INFO: user opted out of zsh by default"
return return
fi fi
if [ ! -x /usr/bin/zsh ]; then if [ ! -x /usr/bin/zsh ]; then
echo "INFO: /usr/bin/zsh is not available" echo "INFO: /usr/bin/zsh is not available"
return return
fi fi
for user in $(get_user_list); do for user in $(get_user_list); do
echo "INFO: changing default shell of user '$user' to zsh" echo "INFO: changing default shell of user '$user' to zsh"
chsh --shell /usr/bin/zsh $user chsh --shell /usr/bin/zsh $user
done done
} }
# This is generically named in case we want to add other groups in the future. # This is generically named in case we want to add other groups in the future.
configure_usergroups() { configure_usergroups() {
# Create the kaboxer group if needed # Create the kaboxer group if needed
addgroup --system kaboxer || true addgroup --system kaboxer || true
# Create the wireshark group if needed # Create the wireshark group if needed
addgroup --system wireshark || true addgroup --system wireshark || true
# kaboxer - for kaboxer # kaboxer - for kaboxer
# dialout - for serial access # dialout - for serial access
# wireshark - capture sessions in wireshark # wireshark - capture sessions in wireshark
kali_groups="kaboxer,dialout,wireshark" kali_groups="kaboxer,dialout,wireshark"
for user in $(get_user_list); do for user in $(get_user_list); do
echo "INFO: adding user '$user' to groups '$kali_groups'" echo "INFO: adding user '$user' to groups '$kali_groups'"
usermod -a -G "$kali_groups" $user || true usermod -a -G "$kali_groups" $user || true
done done
} }
configure_sources_list configure_sources_list

Loading…
Cancel
Save