mopidy-websettings
mopidy-websettings copied to clipboard
Ability to set timezone
Purpose
This is required by Mopidy-AlarmClock integration (https://github.com/woutervanwijk/Pi-MusicBox/issues/270).
Proposed solution
In web interface
- Take list of timezones from folder
/usr/share/zoneinfo/
(may be there is better way to get list of timezones from OS) - Store selected timezone in .ini file
In /opt/musicbox/startup.sh
- Read selected timezone from .ini file
- Ensure that
/usr/share/zoneinfo/$TIMEZONE
is a file -
echo $TIMEZONE > /etc/timezone
-
rm -f /etc/localtime
-
cp /usr/share/zoneinfo/$TIMEZONE /etc/localtime
The code snippet is untested.