Skip to content

Commit

Permalink
fix: check if gdm config file exist before editing
Browse files Browse the repository at this point in the history
Signed-off-by: ZHANG Yuntian <[email protected]>
  • Loading branch information
RadxaYuntian committed Aug 19, 2024
1 parent 33a83c4 commit c5811ce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/usr/lib/rsetup/cli/system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,12 @@ set_gdm_autologin() {
local user="$1" switch="$2"
local config_dir="/etc/gdm3"

if [[ ! -f $config_dir/daemon.conf ]]; then
echo "gdm is not installed. Auto login will not be configured." >&2
return 1
fi

if [[ "$switch" == "ON" ]]; then
mkdir -p "$config_dir"
sed -i '/^# Rsetup/,/# Rsetup$/d' $config_dir/daemon.conf
cat << EOF | tee -a $config_dir/daemon.conf >/dev/null
# Rsetup
Expand Down

0 comments on commit c5811ce

Please sign in to comment.