...
 
Commits (3)
......@@ -3,9 +3,10 @@
# Copyright (C) 2013 Lutz Fiebach (lufie@openelec.tv)
# Copyright (C) 2019 Corey Moyer (cronmod.dev@gmail.com)
ADDON_NAME=script.ember.config
ADDON_VERSION=0.0.1
DISTRONAME:=EmbER
ADDON_NAME?=script.ember.config
ADDON_VERSION?=0.0.1
DISTRONAME?=EmbER
ROOT_PASSWORD?=letmein
SHELL=/bin/bash
BUILDDIR=build
......@@ -36,7 +37,11 @@ $(BUILDDIR)/$(ADDON_NAME): $(BUILDDIR)/$(ADDON_NAME)/resources
sed -e "s,@ADDONNAME@,$(ADDON_NAME),g" \
-e "s,@ADDONVERSION@,$(ADDON_VERSION),g" \
-e "s,@DISTRONAME@,$(DISTRONAME),g" \
-i $(BUILDDIR)/$(ADDON_NAME)/addon.xml
-e "s,@ROOT_PASSWORD@,$(ROOT_PASSWORD),g" \
-i $(BUILDDIR)/$(ADDON_NAME)/addon.xml \
-i $(BUILDDIR)/$(ADDON_NAME)/*.py \
-i $(BUILDDIR)/$(ADDON_NAME)/resources/lib/*.py \
-i $(BUILDDIR)/$(ADDON_NAME)/resources/lib/modules/*.py
cp changelog.txt $(BUILDDIR)/$(ADDON_NAME)
$(BUILDDIR)/$(ADDON_NAME)/resources: $(BUILDDIR)/$(ADDON_NAME)/resources/skins \
......@@ -60,7 +65,8 @@ $(BUILDDIR)/$(ADDON_NAME)/resources/skins/Default/media/icons:
$(BUILDDIR)/$(ADDON_NAME)/resources/language:
mkdir -p $(BUILDDIR)/$(ADDON_NAME)/resources/language
cp -R language/* $(BUILDDIR)/$(ADDON_NAME)/resources/language
sed -e "s,@DISTRONAME@,$(DISTRONAME),g" \
sed -e "s,@ADDONNAME@,$(ADDON_NAME),g" \
-e "s,@DISTRONAME@,$(DISTRONAME),g" \
-e "s,@ROOT_PASSWORD@,$(ROOT_PASSWORD),g" \
-i $(BUILDDIR)/$(ADDON_NAME)/resources/language/*/*.po
......
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.ember.config"
<addon id="@ADDONNAME@"
name="@DISTRONAME@ Configuration"
version="@ADDONVERSION@"
provider-name="ember-dev">
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
"Project-Id-Version: EmbER Configuration Add-on\n"
"Project-Id-Version: @DISTRONAME@ Configuration Add-on\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
"Project-Id-Version: EmbER Configuration Add-on\n"
"Project-Id-Version: @DISTRONAME@ Configuration Add-on\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
# Kodi Media Center language file
# Addon Name: @DISTRONAME@ Configuration
# Addon id: script.ember.config
# Addon id: @ADDONNAME@
# Addon Provider: EmbER-Dev
msgid ""
msgstr ""
......
......@@ -7,7 +7,7 @@ import xbmc
import socket
import xbmcaddon
__scriptid__ = 'script.ember.config'
__scriptid__ = '@ADDONNAME@'
__addon__ = xbmcaddon.Addon(id=__scriptid__)
__cwd__ = __addon__.getAddonInfo('path')
__media__ = '%s/resources/skins/Default/media/' % __cwd__
......@@ -15,8 +15,8 @@ _ = __addon__.getLocalizedString
try:
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.connect('/var/run/script.ember.config.sock')
sock.connect('/var/run/@ADDONNAME@.sock')
sock.send('openConfigurationWindow')
sock.close()
except Exception, e:
xbmc.executebuiltin('Notification("EmbER", "%s", 5000, "%sicons/icon.png")' % (_(32390).encode('utf-8'), __media__))
xbmc.executebuiltin('Notification("@DISTRONAME@", "%s", 5000, "%sicons/icon.png")' % (_(32390).encode('utf-8'), __media__))
......@@ -50,8 +50,8 @@ services = {
'D_SAMBA_MINPROTOCOL': 'SMB2',
'D_SAMBA_MAXPROTOCOL': 'SMB3',
'D_SAMBA_AUTOSHARE': '1',
'SSH_DAEMON': '/usr/sbin/sshd',
'OPT_SSH_NOPASSWD': "-o 'PasswordAuthentication no'",
'SSH_DAEMON': '/usr/sbin/dropbear',
'OPT_SSH_NOPASSWD': '-s',
'D_SSH_DISABLE_PW_AUTH': '0',
'AVAHI_DAEMON': '/usr/sbin/avahi-daemon',
'CRON_DAEMON': '/sbin/crond',
......@@ -88,7 +88,7 @@ about = {'ENABLED': False}
xdbus = {'ENABLED': True}
_services = {
'sshd': ['sshd.service'],
'sshd': ['dropbear.service'],
'avahi': ['avahi-daemon.service'],
'samba': ['nmbd.service', 'smbd.service'],
'bluez': ['bluetooth.service'],
......
......@@ -25,7 +25,7 @@ import shutil
from xml.dom import minidom
__author__ = 'EmbER-Dev'
__scriptid__ = 'script.ember.config'
__scriptid__ = '@ADDONNAME@'
__addon__ = xbmcaddon.Addon(id=__scriptid__)
__cwd__ = __addon__.getAddonInfo('path')
__oe__ = sys.modules[globals()['__name__']]
......@@ -79,7 +79,7 @@ sys.setdefaultencoding(encoding)
## load oeSettings modules
import oeWindows
xbmc.log('## EmbER Addon ## ' + unicode(__addon__.getAddonInfo('version')))
xbmc.log('## @DISTRONAME@ Addon ## ' + unicode(__addon__.getAddonInfo('version')))
def _(code):
......@@ -108,7 +108,7 @@ def _(code):
def dbg_log(source, text, level=4):
if level == 0 and os.environ.get('DEBUG', 'no') == 'no':
return
xbmc.log('## EmbER Addon ## ' + source + ' ## ' + text, level)
xbmc.log('## @DISTRONAME@ Addon ## ' + source + ' ## ' + text, level)
if level == 4:
xbmc.log(traceback.format_exc(), level)
......@@ -280,7 +280,7 @@ def download_file(source, destination, silent=False):
local_file = open(destination, 'wb')
if silent == False:
download_dlg = xbmcgui.DialogProgress()
download_dlg.create('EmbER', _(32181).encode('utf-8'), ' ', ' ')
download_dlg.create('@DISTRONAME@', _(32181).encode('utf-8'), ' ', ' ')
response = urllib2.urlopen(urllib2.quote(source, safe=':/'))
total_size = int(response.info().getheader('Content-Length').strip())
minutes = 0
......@@ -329,7 +329,7 @@ def extract_file(filename, extract, destination, silent=False):
if tarfile.is_tarfile(filename):
if silent == False:
extract_dlg = xbmcgui.DialogProgress()
extract_dlg.create('EmbER ', _(32186).encode('utf-8'), ' ', ' ')
extract_dlg.create('@DISTRONAME@ ', _(32186).encode('utf-8'), ' ', ' ')
extract_dlg.update(0)
compressed = tarfile.open(filename)
names = compressed.getnames()
......@@ -393,7 +393,7 @@ def copy_file(source, destination, silent=False):
destination_file = open(destination, 'wb')
if silent == False:
copy_dlg = xbmcgui.DialogProgress()
copy_dlg.create('EmbER', _(32181).encode('utf-8'), ' ', ' ')
copy_dlg.create('@DISTRONAME@', _(32181).encode('utf-8'), ' ', ' ')
total_size = os.path.getsize(source)
minutes = 0
seconds = 0
......@@ -471,7 +471,7 @@ def stop_service():
for strModule in dictModules:
if hasattr(dictModules[strModule], 'stop_service'):
dictModules[strModule].stop_service()
xbmc.log('## EmbER Addon ## STOP SERVICE DONE !')
xbmc.log('## @DISTRONAME@ Addon ## STOP SERVICE DONE !')
except Exception, e:
dbg_log('oe::stop_service', 'ERROR: (' + repr(e) + ')')
......@@ -686,7 +686,7 @@ def split_dialog_text(text):
def reboot_counter(seconds=10, title=' '):
reboot_dlg = xbmcgui.DialogProgress()
reboot_dlg.create('EmbER %s' % title, ' ', ' ', ' ')
reboot_dlg.create('@DISTRONAME@ %s' % title, ' ', ' ', ' ')
reboot_dlg.update(0)
wait_time = seconds
while seconds >= 0 and not reboot_dlg.iscanceled():
......@@ -826,9 +826,9 @@ BOOT_STATUS = load_file('/root/.config/boot.status')
############################################################################################
try:
configFile = '%s/userdata/addon_data/script.ember.config/settings.xml' % KODI_USER_HOME
if not os.path.exists('%s/userdata/addon_data/script.ember.config' % KODI_USER_HOME):
os.makedirs('%s/userdata/addon_data/script.ember.config' % KODI_USER_HOME)
configFile = '%s/userdata/addon_data/@ADDONNAME@/settings.xml' % KODI_USER_HOME
if not os.path.exists('%s/userdata/addon_data/@ADDONNAME@' % KODI_USER_HOME):
os.makedirs('%s/userdata/addon_data/@ADDONNAME@' % KODI_USER_HOME)
if not os.path.exists('%s/services' % CONFIG_CACHE):
os.makedirs('%s/services' % CONFIG_CACHE)
except:
......
......@@ -697,12 +697,12 @@ class connman:
# IPTABLES
nf_values = [self.oe._(32397), self.oe._(32398), self.oe._(32399)]
nf_custom_rules = [self.NF_CUSTOM_PATH + "rules.v4" , self.NF_CUSTOM_PATH + "rules.v6"]
for custom_rule in nf_custom_rules:
for custom_rule in nf_custom_rules:
if os.path.exists(custom_rule):
nf_values.append(self.oe._(32396))
nf_values.append(self.oe._(32396))
break
self.struct['advanced']['settings']['netfilter']['values'] = nf_values
if self.oe.get_service_state('iptables') == '1':
if self.oe.get_service_state('iptables') == '1':
nf_option = self.oe.get_service_option('iptables', 'RULES', 'home')
if nf_option == "custom":
nf_option_str = self.oe._(32396)
......@@ -1170,7 +1170,7 @@ class connman:
options['RULES'] = "home"
elif self.struct['advanced']['settings']['netfilter']['value'] == self.oe._(32399):
options['RULES'] = "public"
else:
else:
state = 0
self.oe.set_service('iptables', options, state)
self.oe.set_busy(0)
......
......@@ -10,7 +10,7 @@ import xbmc
import xbmcgui
import xbmcaddon
__scriptid__ = 'script.ember.config'
__scriptid__ = '@ADDONNAME@'
__addon__ = xbmcaddon.Addon(id=__scriptid__)
xbmcDialog = xbmcgui.Dialog()
......@@ -622,7 +622,7 @@ class services:
SSHchange = False
newpwd = xbmcDialog.input(self.oe._(746))
if newpwd:
if newpwd == "libreelec":
if newpwd == "@ROOT_PASSWORD@":
self.oe.execute('cp -fp /usr/cache/shadow /root/.cache/shadow')
readout3 = "Retype password"
else:
......
......@@ -602,7 +602,7 @@ class system:
pass
self.backup_dlg = xbmcgui.DialogProgress()
self.backup_dlg.create('EmbER', self.oe._(32375).encode('utf-8'), ' ', ' ')
self.backup_dlg.create('@DISTRONAME@', self.oe._(32375).encode('utf-8'), ' ', ' ')
if not os.path.exists(self.BACKUP_DESTINATION):
os.makedirs(self.BACKUP_DESTINATION)
self.backup_file = self.oe.timestamp() + '.tar'
......
......@@ -395,7 +395,7 @@ class updates:
version = self.oe.VERSION
if self.struct['update']['settings']['Build']['value'] != '':
self.update_file = self.update_json[self.struct['update']['settings']['Channel']['value']]['url'] + self.get_available_builds(self.struct['update']['settings']['Build']['value'])
answer = xbmcDialog.yesno('EmbER Update', self.oe._(32188).encode('utf-8') + ': ' + version.encode('utf-8'),
answer = xbmcDialog.yesno('@DISTRONAME@ Update', self.oe._(32188).encode('utf-8') + ': ' + version.encode('utf-8'),
self.oe._(32187).encode('utf-8') + ': ' + self.struct['update']['settings']['Build']['value'].encode('utf-8'),
self.oe._(32180).encode('utf-8'))
xbmcDialog = None
......
......@@ -14,7 +14,7 @@ from threading import Thread
xbmcDialog = xbmcgui.Dialog()
__scriptid__ = 'script.ember.config'
__scriptid__ = '@ADDONNAME@'
__addon__ = xbmcaddon.Addon(id=__scriptid__)
__cwd__ = __addon__.getAddonInfo('path')
......@@ -292,17 +292,17 @@ class mainWindow(xbmcgui.WindowXMLDialog):
selectedItem.setProperty('value', xbmcKeyboard.getText())
elif strTyp == 'file':
xbmcDialog = xbmcgui.Dialog()
returnValue = xbmcDialog.browse(1, 'EmbER', 'files', '', False, False, '/')
returnValue = xbmcDialog.browse(1, '@DISTRONAME@', 'files', '', False, False, '/')
if returnValue != '' and returnValue != '/':
selectedItem.setProperty('value', unicode(returnValue))
elif strTyp == 'folder':
xbmcDialog = xbmcgui.Dialog()
returnValue = xbmcDialog.browse(0, 'EmbER', 'files', '', False, False, '/root')
returnValue = xbmcDialog.browse(0, '@DISTRONAME@', 'files', '', False, False, '/root')
if returnValue != '' and returnValue != '/':
selectedItem.setProperty('value', unicode(returnValue))
elif strTyp == 'ip':
xbmcDialog = xbmcgui.Dialog()
returnValue = xbmcDialog.numeric(3, 'EmbER', strValue)
returnValue = xbmcDialog.numeric(3, '@DISTRONAME@', strValue)
if returnValue != '':
if returnValue == '0.0.0.0':
selectedItem.setProperty('value', '')
......@@ -312,7 +312,7 @@ class mainWindow(xbmcgui.WindowXMLDialog):
if strValue == 'None' or strValue == '':
strValue = '0'
xbmcDialog = xbmcgui.Dialog()
returnValue = xbmcDialog.numeric(0, 'EmbER', strValue)
returnValue = xbmcDialog.numeric(0, '@DISTRONAME@', strValue)
if returnValue == '':
returnValue = -1
if returnValue > -1:
......
......@@ -20,7 +20,7 @@ class service_thread(threading.Thread):
oeMain.dbg_log('_service_::__init__', 'enter_function', 0)
self.oe = oeMain
self.wait_evt = threading.Event()
self.socket_file = '/var/run/script.ember.config.sock'
self.socket_file = '/var/run/@ADDONNAME@.sock'
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.sock.setblocking(1)
if os.path.exists(self.socket_file):
......