web: offer to shutdown on SIM swap

It currently times out when generating an IMEI.
I wonder what the timeouts are.
This commit is contained in:
Tobias Mueller 2023-10-16 16:57:42 +02:00
parent b02faa7adb
commit 3b87b1b8f4
2 changed files with 17 additions and 1 deletions

View File

@ -30,6 +30,11 @@ elif [ "$1" == "random-imei" ]; then
elif [ "$1" == "shutdown-modem" ]; then
exec gl_modem AT AT+CFUN=4
elif [ "$1" == "shutdown" ]; then
echo '{ "msg": "Shutdowing down..." }' > /dev/ttyS0
halt -d 5
echo -n "Shutting down"
elif [ "$1" == "write-imei" ]; then
new_imei=$2
echo -n { "action": "write" }

View File

@ -771,6 +771,11 @@ function handleConfig(ev)
});
}
function handleShutdown(ev)
{
return callBlueMerle("shutdown")
}
function handleRemove(ev)
{
var name = ev.target.getAttribute('data-package'),
@ -849,10 +854,16 @@ function handleSimSwap(ev) {
),
E('p', { 'class': 'text'},
_("Please shutdown the device and go to another place before booting")
)
),
E('button', { 'class': 'btn cbi-button-positive', 'click': handleShutdown, 'disabled': isReadonlyView }, [ _('Shutdown…') ]), ' ',
}
).catch(
function(err) {
dlg.appendChild(
E('p',{'class': 'error'},
_('Error setting IMEI! ') + err
)
)
}
);
}