mopidy-websettings icon indicating copy to clipboard operation
mopidy-websettings copied to clipboard

Ability to set timezone

Open DavisNT opened this issue 9 years ago • 0 comments

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.

DavisNT avatar Apr 11 '15 13:04 DavisNT