# Creating a root user.
# usermod -s /usr/bin/zsh root
function user_check () {
-if [[ $(getent passwd $1 > /dev/null ; printf $?) = 0 ]]; then
- if [[ -z $1 ]]; then
+ if [[ $(getent passwd $1 > /dev/null ; printf $?) = 0 ]]; then
+ if [[ -z $1 ]]; then
+ echo -n "false"
+ fi
+ echo -n "true"
+ else
echo -n "false"
fi
- echo -n "true"
-else
- echo -n "false"
-fi
}
# Parse arguments
l) language="${OPTARG}" ;;
esac
done
-root_passwd=${password}
+
+
+root_passwd="${password}"
#usermod -s "${usershell}" root
cp -aT /etc/skel/ /root/
+
# Allow sudo group to run sudo
sed -i 's/^#\s*\(%sudo\s\+ALL=(ALL)\s\+ALL\)/\1/' /etc/sudoers
# Enable and generate languages.
echo "LANG=${localegen}" > /etc/locale.conf
-# Setting the time zone.
-ln -sf /usr/share/zoneinfo/${timezone} /etc/localtime
+# Setting the time zone.
+ln -sf "/usr/share/zoneinfo/${timezone}" "/etc/localtime"
# Set up auto login
-if [[ -f /etc/systemd/system/getty@tty1.service.d/override.conf ]]; then
- sed -i s/%USERNAME%/"${username}"/g /etc/systemd/system/getty@tty1.service.d/override.conf
+if [[ -f "/etc/systemd/system/getty@tty1.service.d/override.conf" ]]; then
+ sed -i s/%USERNAME%/"${username}"/g "/etc/systemd/system/getty@tty1.service.d/override.conf"
fi
# Set to execute calamares without password as alter user.
# Chnage sudoers permission
chmod 750 -R /etc/sudoers.d/
chown root:root -R /etc/sudoers.d/
+
+echo "LANG=${locale_gen_name}" > "/etc/locale.conf"
+truncate -s 0 /etc/machine-id
+passwd -u -f root
\ No newline at end of file
}
make_config() {
-
# customize_airootfs options
# -b : Enable boot splash.
# -d : Enable debug mode.
}
_run_script "/root/customize_airootfs.sh" "/root/customize_airootfs_${channel_name}.sh"
-
- run_cmd ln -sf /usr/share/zoneinfo/${locale_time} /etc/localtime
- echo "LANG=${locale_gen_name}" > "${work_dir}/airootfs/etc/locale.conf"
- run_cmd truncate -s 0 /etc/machine-id
- run_cmd passwd -u -f root
}
make_clean() {