Skip to content

Commit e3dcffb

Browse files
committed
Fix Description Update
1 parent 7a76486 commit e3dcffb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

module/service.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ update_description() {
2020
esac
2121

2222
local desc="TCP Optimisations & update tcp_cong_algo based on interface | iface: $iface $icon | algo: $algo"
23-
sed -i '/^description=/d' "$MODPATH/module.prop" && echo "description=$desc" >> "$MODPATH/module.prop"
23+
# Remove old description
24+
sed -i '/^description=/d' "$MODPATH/module.prop"
25+
# Append new description with leading newline
26+
printf '\ndescription=%s\n' "$desc" >> "$MODPATH/module.prop"
2427
}
2528

2629
kill_tcp_connections() {
@@ -156,7 +159,10 @@ apply_cellular_settings() {
156159
# On startup, reset description to default
157160
if [ -f "$MODPATH/module.prop" ]; then
158161
default_desc="TCP Optimisations & update tcp_cong_algo based on interface"
159-
sed -i '/^description=/d' "$MODPATH/module.prop" && echo "description=$default_desc" >> "$MODPATH/module.prop"
162+
# Remove existing description line (if any)
163+
sed -i '/^description=/d' "$MODPATH/module.prop"
164+
# Append new description with leading newline for safety
165+
printf '\ndescription=%s\n' "$default_desc" >> "$MODPATH/module.prop"
160166
fi
161167

162168
# IPv4 TCP optimizations

0 commit comments

Comments
 (0)