Skip to content

Commit

Permalink
fix: create file if not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotfirenet committed Jul 11, 2024
1 parent ae8143b commit 53be4df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions data/patchs/root/usr/bin/jeedomLTE
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
# systemctl status jeedomLTE.service

LOGFILE=/var/www/html/log/jeedomLTE
if [ ! -f "$LOGFILE" ]; then
touch "$LOGFILE"
fi
chown www-data:www-data $LOGFILE
DEBUG=true

Expand Down Expand Up @@ -81,6 +84,7 @@ _modem_read_class_value() {
local output=$(cat /sys/class/leds/$lte/brightness)
if [ "$output" != "1" ]; then
return 1
fi
done
return 0
}
Expand Down Expand Up @@ -112,6 +116,7 @@ case "$1" in
result=$?
debug_log "Connection result: $result"
if [ $result -eq 1 ]; then
DEBUG=FALSE
debug_log "Modem is already connected."
if [ ! -f /boot/jeedomLTE ]; then
echo "1" | tee /boot/jeedomLTE > /dev/null
Expand All @@ -120,6 +125,8 @@ case "$1" in
if [ "$content" != "1" ]; then
echo "1" | tee /boot/jeedomLTE > /dev/null
fi
sleep 20
continue
else
max_attempts=5
for attempt in $(seq 1 $max_attempts); do
Expand Down

0 comments on commit 53be4df

Please sign in to comment.