Skip to content

Commit

Permalink
Add date_reset_workaround (fixes #41)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hagen Fritsch committed Jan 9, 2022
1 parent f238adf commit 84408e9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions viomi-root.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ EOT
restore_robot_services
fi
fi

date_reset_workaround

read -p "Would you like to install Valetudo (open-source cloudless vacuum robot UI)? (y/n) " -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]
Expand Down Expand Up @@ -176,6 +178,18 @@ function restore_robot_services() {
ssh vacuum "tinyplayer /usr/share/audio/english/sound_test_ready.mp3"
}

function date_reset_workaround() {
# Some process seems to reset datetime after boot. Workaround per:
# https://github.com/rumpeltux/viomi-rooting/issues/41
ssh vacuum "cat > /usr/sbin/date; chmod +x /usr/sbin/date" <<"EOF"
/bin/date -u -s "$2"
sleep 2
/bin/date -u -s "$2"
sleep 2
/bin/date -u -s "$2"
EOF
}

function install_valetudo() {
wget "https://github.com/Hypfer/Valetudo/releases/download/2021.03.0/valetudo-armv7" -O valetudo
chmod +x valetudo
Expand Down

0 comments on commit 84408e9

Please sign in to comment.