Created
July 1, 2022 04:10
-
-
Save tserong/3ba2cdeae3fe2d9ac69b0d076d14febc to your computer and use it in GitHub Desktop.
/data/rc.local script for Victron Cerbo GX to install custom crontab entry to run /home/root/sched.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if ! grep -q 'sched\.py' /etc/crontab; then | |
mount | grep -q 'on / .*ro' | |
is_ro=$? | |
if [ $is_ro -eq 0 ]; then | |
mount -o remount,rw / | |
fi | |
cat >> /etc/crontab <<EOF | |
# Set scheduled charges based on zcell maintenance cycle | |
0 21 * * * root TZ=\$(dbus -y com.victronenergy.settings /Settings/System/TimeZone GetValue | tr -d "'") /home/root/sched.py 10.1.1.133 | |
EOF | |
if [ $is_ro -eq 0 ]; then | |
mount -o remount,ro / | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment