Skip to content

Commit 06a7edf

Browse files
committed
[Pre-Release] 0.4.1i - Minor fixes #336 and versioning
Changes to be committed: modified: VERSION modified: src/static/static/home/yi-hack-v5/etc/system.conf modified: src/static/static/home/yi-hack-v5/script/check_conf.sh modified: src/static/static/home/yi-hack-v5/script/check_update.sh modified: src/static/static/home/yi-hack-v5/script/clean_records.sh modified: src/static/static/home/yi-hack-v5/script/cloudAPI modified: src/static/static/home/yi-hack-v5/script/cloudAPI_fake modified: src/static/static/home/yi-hack-v5/script/conf2mqtt.sh modified: src/static/static/home/yi-hack-v5/script/configure_wifi.sh modified: src/static/static/home/yi-hack-v5/script/default.script modified: src/static/static/home/yi-hack-v5/script/env.sh modified: src/static/static/home/yi-hack-v5/script/ftppush.sh modified: src/static/static/home/yi-hack-v5/script/launch.sh modified: src/static/static/home/yi-hack-v5/script/mqtt_advertise/mqtt_adv_homeassistant.sh modified: src/static/static/home/yi-hack-v5/script/mqtt_advertise/mqtt_adv_info_global.sh modified: src/static/static/home/yi-hack-v5/script/system.sh modified: src/static/static/home/yi-hack-v5/script/system_init.sh modified: src/static/static/home/yi-hack-v5/script/wd_rtsp.sh modified: src/static/static/home/yi-hack-v5/script/wifidhcp.sh modified: src/www/httpd/cgi-bin/links.sh modified: src/www/httpd/cgi-bin/load.sh modified: src/www/httpd/cgi-bin/service.sh
1 parent 87620df commit 06a7edf

22 files changed

+41
-21
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.1h
1+
0.4.1i

src/static/static/home/yi-hack-v5/etc/system.conf

-1
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,4 @@ TIMELAPSE=no
4343
TIMELAPSE_FTP=no
4444
TIMELAPSE_DT=60
4545
TIMELAPSE_VDT=
46-
TIME_OSD=no
4746
DEBUG_LOG=no

src/static/static/home/yi-hack-v5/script/check_conf.sh

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
# 0.4.1i
4+
35
SYSTEM_CONF_FILE="/tmp/sd/yi-hack-v5/etc/system.conf"
46
CAMERA_CONF_FILE="/tmp/sd/yi-hack-v5/etc/camera.conf"
57
MQTTV4_CONF_FILE="/tmp/sd/yi-hack-v5/etc/mqttv4.conf"

src/static/static/home/yi-hack-v5/script/check_update.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/bin/sh
22

3+
# 0.4.1i
4+
35
CONF_FILE="etc/system.conf"
46

57
YI_HACK_PREFIX="/tmp/sd/yi-hack-v5"
68

79
get_config()
810
{
911
key=$1
10-
grep $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
12+
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
1113
}
1214

1315
MAX_RETRY=10

src/static/static/home/yi-hack-v5/script/clean_records.sh

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
# 0.4.1i
4+
35
if [ $# -ne 1 ]; then
46
exit
57
fi

src/static/static/home/yi-hack-v5/script/cloudAPI

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
# 0.4.1d
3+
# 0.4.1i
44

55
ulimit -s 1024
66
export LD_LIBRARY_PATH=/home/lib:$LD_LIBRARY_PATH
@@ -22,8 +22,8 @@ fi
2222

2323
get_config()
2424
{
25-
key=$1
26-
grep $1 $YI_HACK_V5_PREFIX/$CONF_FILE | cut -d "=" -f2
25+
key=$1
26+
grep -w $1 $YI_HACK_V5_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
2727
}
2828

2929
if [[ $(get_config DISABLE_CLOUD) == "yes" ]] ; then

src/static/static/home/yi-hack-v5/script/cloudAPI_fake

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
# 0.4.0c
3+
# 0.4.1i
44

55
CONF_FILE="etc/system.conf"
66
if [ -d "/tmp/sd/yi-hack-v5" ]; then
@@ -12,7 +12,7 @@ fi
1212
get_config()
1313
{
1414
key=$1
15-
grep -w $1 $YI_HACK_V5_PREFIX/$CONF_FILE | cut -d "=" -f2
15+
grep -w $1 $YI_HACK_V5_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
1616
}
1717

1818
while test $# -gt 0

src/static/static/home/yi-hack-v5/script/conf2mqtt.sh

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
# 0.4.1i
4+
35
YI_HACK_V5_PREFIX="/tmp/sd/yi-hack-v5"
46
CAMERA_CONF_FILE="$YI_HACK_V5_PREFIX/etc/camera.conf"
57
MQTT_CONF_FILE="$YI_HACK_V5_PREFIX/etc/mqttv4.conf"

src/static/static/home/yi-hack-v5/script/configure_wifi.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
# 0.4.1a
3+
# 0.4.1i
44

55
function print_help {
66
echo "configure_wifi.sh"

src/static/static/home/yi-hack-v5/script/default.script

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/sh
2+
3+
# 0.4.1i
4+
25
# udhcpc script edited by Tim Riker <[email protected]>
36

47
RESOLV_CONF="/tmp/resolv.conf"

src/static/static/home/yi-hack-v5/script/env.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
# 0.4.1i
4+
35
CONF_FILE="etc/system.conf"
46

57
YI_HACK_PREFIX="/tmp/sd/yi-hack-v5"
@@ -10,7 +12,7 @@ export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/home/base/tools:/home/yi-hack-v5/bin:
1012
get_config()
1113
{
1214
key=$1
13-
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
15+
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
1416
}
1517

1618
TZ_CONF=$(get_config TIMEZONE)

src/static/static/home/yi-hack-v5/script/ftppush.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/ash
22
#
3+
# 0.4.1i
4+
#
35
# Command line:
46
# ash "/tmp/sd/yi-hack-v5/script/ftppush.sh" cron
57
# ash "/tmp/sd/yi-hack-v5/script/ftppush.sh" start
@@ -12,8 +14,9 @@ YI_HACK_PREFIX="/tmp/sd/yi-hack-v5"
1214
get_config()
1315
{
1416
key=$1
15-
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
17+
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
1618
}
19+
1720
# Setup env.
1821
export LD_LIBRARY_PATH=/lib:/usr/lib:/home/lib:/home/app/locallib:/home/hisiko/hisilib:/tmp/sd/yi-hack-v5/lib:/home/yi-hack-v5/lib
1922
export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/home/base/tools:/home/yi-hack-v5/bin:/home/app/localbin:/home/base:/tmp/sd/yi-hack-v5/bin:/tmp/sd/yi-hack-v5/sbin:/tmp/sd/yi-hack-v5/usr/bin:/tmp/sd/yi-hack-v5/usr/sbin:/home/yi-hack-v5/sbin

src/static/static/home/yi-hack-v5/script/launch.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#
3-
# 0.4.1b
3+
# 0.4.1i
44
#
55
# This file is part of yi-hack-v5 (https://github.com/alienatedsec/yi-hack-v5).
66
# Copyright (c) 2021-2023 alienatedsec - v5 specific

src/static/static/home/yi-hack-v5/script/mqtt_advertise/mqtt_adv_homeassistant.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ if [ "$MQTT_ADV_CAMERA_SETTING_ENABLE" == "yes" ]; then
311311
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:remote","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_CAMERA_SETTING_TOPIC'","command_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_CAMERA_SETTING_TOPIC'/IR/set","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.IR }}","payload_on":"yes","payload_off":"no", "platform": "mqtt"}'
312312
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
313313
# Rotate
314-
UNIQUE_NAME=" Rotate"
314+
UNIQUE_NAME="Rotate"
315315
UNIQUE_ID=$IDENTIFIERS"-ROTATE"
316316
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/switch/$IDENTIFIERS/ROTATE/config
317317
CONTENT='{"availability_topic":"'$MQTT_PREFIX'/'$TOPIC_BIRTH_WILL'","payload_available":"'$BIRTH_MSG'","payload_not_available":"'$WILL_MSG'","device":{"identifiers":["'$IDENTIFIERS'"],"manufacturer":"'$MANUFACTURER'","model":"'$MODEL'","name":"'$NAME'","sw_version":"'$SW_VERSION'"},'$QOS' '$RETAIN' "icon":"mdi:monitor","state_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_CAMERA_SETTING_TOPIC'","command_topic":"'$MQTT_PREFIX'/'$MQTT_ADV_CAMERA_SETTING_TOPIC'/ROTATE/set","name":"'$UNIQUE_NAME'","unique_id":"'$UNIQUE_ID'","value_template":"{{ value_json.ROTATE }}","payload_on":"yes","payload_off":"no", "platform": "mqtt"}'

src/static/static/home/yi-hack-v5/script/mqtt_advertise/mqtt_adv_info_global.sh

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ CONF_MQTT_ADVERTISE_FILE="etc/mqtt_advertise.conf"
77
PATH=$PATH:$YI_HACK_PREFIX/bin:$YI_HACK_PREFIX/usr/bin:/bin:/usr/bin
88
LD_LIBRARY_PATH=$YI_HACK_PREFIX/lib:/lib:$LD_LIBRARY_PATH
99

10-
1110
get_config() {
1211
key=^$1
1312
grep -w $key $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2

src/static/static/home/yi-hack-v5/script/system.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
# 0.4.1g
3+
# 0.4.1i
44

55
CONF_FILE="etc/system.conf"
66

@@ -18,7 +18,7 @@ YI_HACK_UPGRADE_PATH="/tmp/sd/$MODEL_SUFFIX"
1818
get_config()
1919
{
2020
key=$1
21-
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
21+
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
2222
}
2323

2424
export LD_LIBRARY_PATH=/lib:/usr/lib:/home/lib:/home/app/locallib:/home/hisiko/hisilib:/tmp/sd/yi-hack-v5/lib:/home/yi-hack-v5/lib

src/static/static/home/yi-hack-v5/script/system_init.sh

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
# 0.4.1i
4+
35
if [ -d "/usr/yi-hack-v5" ]; then
46
YI_HACK_V5_PREFIX="/usr"
57
YI_PREFIX="/home"

src/static/static/home/yi-hack-v5/script/wd_rtsp.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
# 0.4.0d
3+
# 0.4.1i
44

55
script_name=$(basename -- "$0")
66

@@ -20,7 +20,7 @@ LOG_FILE="/tmp/sd/wd_rtsp.log"
2020
get_config()
2121
{
2222
key=$1
23-
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
23+
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
2424
}
2525

2626
COUNTER=0

src/static/static/home/yi-hack-v5/script/wifidhcp.sh

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#!/bin/sh
2+
3+
# 0.4.1i
4+
15
killall udhcpc
26
HN="yi-hack-v5"
37
if [ -f /tmp/sd/yi-hack-v5/etc/hostname ]; then

src/www/httpd/cgi-bin/links.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ YI_HACK_PREFIX="/tmp/sd/yi-hack-v5"
77
get_config()
88
{
99
key=$1
10-
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
10+
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
1111
}
1212

1313
LOCAL_IP_WLAN=$(ifconfig wlan0 | awk '/inet addr/{print substr($2,6)}')

src/www/httpd/cgi-bin/load.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ YI_HACK_PREFIX="/tmp/sd/yi-hack-v5"
77
get_config()
88
{
99
key=$1
10-
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
10+
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
1111
}
1212

1313
# Files

src/www/httpd/cgi-bin/service.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fi
1515
get_config()
1616
{
1717
key=$1
18-
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
18+
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
1919
}
2020

2121
init_config()

0 commit comments

Comments
 (0)