Install and start a Logitech Media Server (lms).

    More infos:
     * http://wiki.slimdevices.com/index.php/Logitech_Media_Server
     * http://wiki.slimdevices.com/index.php/DebianPackage
     * http://www.mysqueezebox.com/download
     * XSqueeze on Kodi:
       * http://kodi.wiki/view/Add-on:XSqueeze
       * http://forum.kodi.tv/showthread.php?tid=122199

def lms():
    '''Install and start a Logitech Media Server (lms).

    More infos:
     * http://wiki.slimdevices.com/index.php/Logitech_Media_Server
     * http://wiki.slimdevices.com/index.php/DebianPackage
     * http://www.mysqueezebox.com/download
     * XSqueeze on Kodi:
       * http://kodi.wiki/view/Add-on:XSqueeze
       * http://forum.kodi.tv/showthread.php?tid=122199
    '''
    # cf. http://wiki.slimdevices.com/index.php/DebianPackage#installing_7.9.0
    cmds = '''\
url="http://www.mysqueezebox.com/update/?version=7.9.0&revision=1&geturl=1&os=deb"
latest_lms=$(wget -q -O - "$url")
mkdir -p ~/.logitech_media_server_sources
cd ~/.logitech_media_server_sources
wget $latest_lms
lms_deb=${latest_lms##*/}
sudo dpkg -i $lms_deb
'''
    run(cmds)
    run('sudo usermod -aG audio  squeezeboxserver')
    with warn_only():
        run('sudo addgroup lms')
    run('sudo usermod -aG lms  squeezeboxserver')
    username = env.user
    run(flo('sudo usermod -aG audio  {username}'))
    print('\n    Set correct folder permissions manually, eg:')
    print('    > ' + cyan(flo('chown -R {username}.lms  <path/to/your/media>')))
    hostname = env.host
    print(flo('\n    lms frontend available at http://{hostname}:9000'))