Skip to content

Commit

Permalink
format: explicitly quote strings with variables
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 c5811ce commit 40d92e7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/usr/lib/rsetup/cli/system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ set_gdm_autologin() {
fi

if [[ "$switch" == "ON" ]]; then
sed -i '/^# Rsetup/,/# Rsetup$/d' $config_dir/daemon.conf
cat << EOF | tee -a $config_dir/daemon.conf >/dev/null
sed -i '/^# Rsetup/,/# Rsetup$/d' "$config_dir/daemon.conf"
cat << EOF | tee -a "$config_dir/daemon.conf" >/dev/null
# Rsetup
# Auto generated by rsetup
# DO NOT MODIFY!
Expand All @@ -262,7 +262,7 @@ AutomaticLoginEnable=true
# Rsetup
EOF
else
sed -i '/^# Rsetup/,/# Rsetup$/d' $config_dir/daemon.conf
sed -i '/^# Rsetup/,/# Rsetup$/d' "$config_dir/daemon.conf"
fi
}

Expand All @@ -272,7 +272,7 @@ set_lightdm_autologin() {

if [[ "$switch" == "ON" ]]; then
mkdir -p "$config_dir"
cat << EOF | tee -a $config_dir/50-rsetup-autologin.conf >/dev/null
cat << EOF | tee -a "$config_dir/50-rsetup-autologin.conf" >/dev/null
# Auto generated by rsetup
# DO NOT MODIFY!
[Seat:*]
Expand All @@ -289,7 +289,7 @@ get_autologin_status() {

case "$service" in
*getty@*.service)
if grep -q -e "--autologin" <(grep -v '^#' "/etc/systemd/system/$service.d/50-rsetup-autologin.conf")
if grep -q -e "--autologin" <(grep -v '^#' "/etc/systemd/system/${service}.d/50-rsetup-autologin.conf")
then
echo "ON"
else
Expand Down

0 comments on commit 40d92e7

Please sign in to comment.