Skip to content

Commit

Permalink
Remove unused rtsp users from the db
Browse files Browse the repository at this point in the history
  • Loading branch information
roleoroleo committed Aug 30, 2021
1 parent 5d2c4b4 commit 8da103b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/static/static/sonoff-hack/script/system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,19 @@ else
fi

# Create hack user if doesn't exist
# And remove existing users:
#10001|1|admin|12345678|
#10002|1|rtsp|12345678|
HACK_USER=$(sqlite3 /mnt/mtd/db/ipcsys.db "select count(*) from t_user where C_UserID=10101;")
if [[ $HACK_USER -eq 0 ]]; then
sqlite3 /mnt/mtd/db/ipcsys.db "insert into t_user (C_UserID, c_role_id, C_UserName, C_PassWord) values (10101, 1, 'hack', 'hack');"
sqlite3 /mnt/mtd/db/ipcsys.db <<EOF &
.timeout 3000
delete from t_user where C_UserId < 10100;
EOF
sqlite3 /mnt/mtd/db/ipcsys.db <<EOF &
.timeout 3000
insert into t_user (C_UserID, c_role_id, C_UserName, C_PassWord) values (10101, 1, 'hack', 'hack');
EOF
fi

if [[ x$(get_config USERNAME) != "x" ]] ; then
Expand Down

0 comments on commit 8da103b

Please sign in to comment.