Skip to content

Commit

Permalink
[Pre-Release] 0.4.1i - Minor fixes #336 and versioning
Browse files Browse the repository at this point in the history
 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
  • Loading branch information
alienatedsec committed Feb 14, 2024
1 parent 87620df commit 06a7edf
Show file tree
Hide file tree
Showing 22 changed files with 41 additions and 21 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.1h
0.4.1i
1 change: 0 additions & 1 deletion src/static/static/home/yi-hack-v5/etc/system.conf
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ TIMELAPSE=no
TIMELAPSE_FTP=no
TIMELAPSE_DT=60
TIMELAPSE_VDT=
TIME_OSD=no
DEBUG_LOG=no
2 changes: 2 additions & 0 deletions src/static/static/home/yi-hack-v5/script/check_conf.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

# 0.4.1i

SYSTEM_CONF_FILE="/tmp/sd/yi-hack-v5/etc/system.conf"
CAMERA_CONF_FILE="/tmp/sd/yi-hack-v5/etc/camera.conf"
MQTTV4_CONF_FILE="/tmp/sd/yi-hack-v5/etc/mqttv4.conf"
Expand Down
4 changes: 3 additions & 1 deletion src/static/static/home/yi-hack-v5/script/check_update.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/bin/sh

# 0.4.1i

CONF_FILE="etc/system.conf"

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

get_config()
{
key=$1
grep $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
}

MAX_RETRY=10
Expand Down
2 changes: 2 additions & 0 deletions src/static/static/home/yi-hack-v5/script/clean_records.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

# 0.4.1i

if [ $# -ne 1 ]; then
exit
fi
Expand Down
6 changes: 3 additions & 3 deletions src/static/static/home/yi-hack-v5/script/cloudAPI
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

# 0.4.1d
# 0.4.1i

ulimit -s 1024
export LD_LIBRARY_PATH=/home/lib:$LD_LIBRARY_PATH
Expand All @@ -22,8 +22,8 @@ fi

get_config()
{
key=$1
grep $1 $YI_HACK_V5_PREFIX/$CONF_FILE | cut -d "=" -f2
key=$1
grep -w $1 $YI_HACK_V5_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
}

if [[ $(get_config DISABLE_CLOUD) == "yes" ]] ; then
Expand Down
4 changes: 2 additions & 2 deletions src/static/static/home/yi-hack-v5/script/cloudAPI_fake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

# 0.4.0c
# 0.4.1i

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

while test $# -gt 0
Expand Down
2 changes: 2 additions & 0 deletions src/static/static/home/yi-hack-v5/script/conf2mqtt.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

# 0.4.1i

YI_HACK_V5_PREFIX="/tmp/sd/yi-hack-v5"
CAMERA_CONF_FILE="$YI_HACK_V5_PREFIX/etc/camera.conf"
MQTT_CONF_FILE="$YI_HACK_V5_PREFIX/etc/mqttv4.conf"
Expand Down
2 changes: 1 addition & 1 deletion src/static/static/home/yi-hack-v5/script/configure_wifi.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

# 0.4.1a
# 0.4.1i

function print_help {
echo "configure_wifi.sh"
Expand Down
3 changes: 3 additions & 0 deletions src/static/static/home/yi-hack-v5/script/default.script
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/sh

# 0.4.1i

# udhcpc script edited by Tim Riker <Tim@Rikers.org>

RESOLV_CONF="/tmp/resolv.conf"
Expand Down
4 changes: 3 additions & 1 deletion src/static/static/home/yi-hack-v5/script/env.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

# 0.4.1i

CONF_FILE="etc/system.conf"

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

TZ_CONF=$(get_config TIMEZONE)
Expand Down
5 changes: 4 additions & 1 deletion src/static/static/home/yi-hack-v5/script/ftppush.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/ash
#
# 0.4.1i
#
# Command line:
# ash "/tmp/sd/yi-hack-v5/script/ftppush.sh" cron
# ash "/tmp/sd/yi-hack-v5/script/ftppush.sh" start
Expand All @@ -12,8 +14,9 @@ YI_HACK_PREFIX="/tmp/sd/yi-hack-v5"
get_config()
{
key=$1
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
}

# Setup env.
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
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
Expand Down
2 changes: 1 addition & 1 deletion src/static/static/home/yi-hack-v5/script/launch.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# 0.4.1b
# 0.4.1i
#
# This file is part of yi-hack-v5 (https://github.com/alienatedsec/yi-hack-v5).
# Copyright (c) 2021-2023 alienatedsec - v5 specific
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ if [ "$MQTT_ADV_CAMERA_SETTING_ENABLE" == "yes" ]; then
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"}'
$YI_HACK_PREFIX/bin/mosquitto_pub -i $HOSTNAME $HA_QOS $HA_RETAIN -h $HOST -t $TOPIC -m "$CONTENT"
# Rotate
UNIQUE_NAME=" Rotate"
UNIQUE_NAME="Rotate"
UNIQUE_ID=$IDENTIFIERS"-ROTATE"
TOPIC=$HOMEASSISTANT_MQTT_PREFIX/switch/$IDENTIFIERS/ROTATE/config
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"}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ CONF_MQTT_ADVERTISE_FILE="etc/mqtt_advertise.conf"
PATH=$PATH:$YI_HACK_PREFIX/bin:$YI_HACK_PREFIX/usr/bin:/bin:/usr/bin
LD_LIBRARY_PATH=$YI_HACK_PREFIX/lib:/lib:$LD_LIBRARY_PATH


get_config() {
key=^$1
grep -w $key $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
Expand Down
4 changes: 2 additions & 2 deletions src/static/static/home/yi-hack-v5/script/system.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

# 0.4.1g
# 0.4.1i

CONF_FILE="etc/system.conf"

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

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
Expand Down
2 changes: 2 additions & 0 deletions src/static/static/home/yi-hack-v5/script/system_init.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

# 0.4.1i

if [ -d "/usr/yi-hack-v5" ]; then
YI_HACK_V5_PREFIX="/usr"
YI_PREFIX="/home"
Expand Down
4 changes: 2 additions & 2 deletions src/static/static/home/yi-hack-v5/script/wd_rtsp.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

# 0.4.0d
# 0.4.1i

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

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

COUNTER=0
Expand Down
4 changes: 4 additions & 0 deletions src/static/static/home/yi-hack-v5/script/wifidhcp.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh

# 0.4.1i

killall udhcpc
HN="yi-hack-v5"
if [ -f /tmp/sd/yi-hack-v5/etc/hostname ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/www/httpd/cgi-bin/links.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ YI_HACK_PREFIX="/tmp/sd/yi-hack-v5"
get_config()
{
key=$1
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
}

LOCAL_IP_WLAN=$(ifconfig wlan0 | awk '/inet addr/{print substr($2,6)}')
Expand Down
2 changes: 1 addition & 1 deletion src/www/httpd/cgi-bin/load.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ YI_HACK_PREFIX="/tmp/sd/yi-hack-v5"
get_config()
{
key=$1
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
}

# Files
Expand Down
2 changes: 1 addition & 1 deletion src/www/httpd/cgi-bin/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fi
get_config()
{
key=$1
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2 | awk 'NR==1 {print; exit}'
}

init_config()
Expand Down

0 comments on commit 06a7edf

Please sign in to comment.