Hi.
I am trying to create a pattern/template so that I get started with using genieacs effectively.
Assume a default installation of genieacs. (This comes with 3 predefined presets: bootstrap
, default
and inform
).
I have only added a custom preset with an attached provision script that sets a PROVISIONED
tag.
//contents of my custom script
const now = new Date();
let tag = declare("Tags.PROVISIONED", { value: 1 });
if (tag.value != null) {
log("Tags.Provisioned already set, returning...");
return;
}
//TODO: do some custom settings here, like wifi, vlans, etc...
declare("Tags.PROVISIONED", null, { value: true });
I had done a single line modification to the bootstrap
script that removes the PROVISIONED
tag
//contents of bootstrap script
const now = Date.now();
// Clear cached data model to force a refresh
clear("Device", now);
clear("InternetGatewayDevice", now);
//remove tag
declare("Tags.PROVISIONED", null, { value: false });
With these settings, all seems good. A CPE registers and it has the PROVISIONED
tag set.
However, when I factory reboot the CPE (which invokes the 0 BOOTSTRAP
event), I expect that the PROVISIONED
tag will be removed by bootstrap
script, and then eventually set again by my custom provision script once it’s done doing its job.
What instead happens is that I get an error:
Why is it the case? I browsed the forums and it has been repeatedly mentioned that this pattern of clearing Tags on bootstrap event and then doing work in a provision script and setting a tag to mark it as finished (so that it doesn’t get called again) is supposedly a good approach.