require('luci.sys')
require('luci.util')
local ipkg = require('luci.model.ipkg')
local fs = require 'nixio.fs'
local uci = require 'luci.model.uci'.cursor()
local m, s
local running = (luci.sys.call('pidof rclone > /dev/null') == 0)
local state_msg = ''
local trport = uci:get('rclone', 'config', 'port')
local triptype = uci:get('rclone', 'config', 'addr_type')
local trip = ''
if triptype == 'local' then
trip = uci:get('network', 'loopback', 'ipaddr')
elseif triptype == 'lan' then
trip = uci:get('network', 'lan', 'ipaddr')
else
trip = '[ip]'
end
if running then
state_msg = '' .. translate('rclone running') .. ''
address_msg = translate('rclone address') .. ' : http://' .. trip .. ':' .. trport .. '
'
else
state_msg = '' .. translate('rclone not run') .. ''
address_msg = ''
end
if ipkg.installed("rclone-webui-react") and ipkg.installed("rclone-ng") then
m =
Map(
'rclone',
translate('Rclone'),
translate('Rclone ("rsync for cloud storage") is a command line program to sync root/usr/bin and directories to and from different cloud storage providers.') ..
'
"
)
elseif ipkg.installed("rclone-webui-react") then
m =
Map(
'rclone',
translate('Rclone'),
translate('Rclone ("rsync for cloud storage") is a command line program to sync root/usr/bin and directories to and from different cloud storage providers.') ..
'
'
.. address_msg ..
translate('Installed Web Interface') ..
' "
)
elseif ipkg.installed("rclone-ng") then
m =
Map(
'rclone',
translate('Rclone'),
translate('Rclone ("rsync for cloud storage") is a command line program to sync root/usr/bin and directories to and from different cloud storage providers.') ..
'
'
.. address_msg ..
translate('Installed Web Interface') ..
'
"
)
else
m =
Map(
'rclone',
translate('Rclone'),
translate('Rclone ("rsync for cloud storage") is a command line program to sync root/usr/bin and directories to and from different cloud storage providers.') ..
'