<div dir="ltr">Since your doing a download task, it should be possible to use the timestamp on the Downloads key to figure out if anything has happened recently. Something like:<div><br></div><div>let now = Date.now();</div><div><div>let downloads = declare("Downloads", {value: 1});</div></div><div><br></div><div>if (downloads.timestamp - now < (60 * 1000)) {</div><div>  //The downloads node has had some action within the past 60 seconds, bail.</div><div>  return;</div><div>}</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 6, 2017 at 10:35 AM, Oliver Kraitschy <span dir="ltr"><<a href="mailto:oliver@okraits.de" target="_blank">oliver@okraits.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Am 06.09.2017 um 20:01 schrieb Dan Morphis:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You will need to use tags/another mechanism to prevent the script from running multiple times if thats what you need. Provisioning scripts are designed to be run as many times as necessary until no more changes are detected. Is there a reason you don't want the provisioning script run multiple times? Are you changing the PPP password? What I did to work around the password issue is make the acct password deterministic:<br>
<br>
password = sha1("device-serial:username:s<wbr>ecret-code").substring(0,16)<br>
</blockquote>
<br></span>
No, I'm calling an external script to create a firmware download task, modify the inform interval and create a refreshObject task, via the REST API. I also already use a tag to deactivate the script. Via the REST API, I can select a firmware file by OUI and ProductClass, which is not possible with only a provision.<br>
<br>
The problem is that the last step (create tag, change inform interval and create refreshObject task) is done twice because the provision and thus the extension is run twice.<br>
<br>
Greetings,<br>
Oliver<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
On Tue, Sep 5, 2017 at 11:21 PM, Oliver Kraitschy <<a href="mailto:oliver@okraits.de" target="_blank">oliver@okraits.de</a> <mailto:<a href="mailto:oliver@okraits.de" target="_blank">oliver@okraits.de</a>>> wrote:<br>
<br>
    Am 06.09.2017 08:33, schrieb Oliver Kraitschy:<br>
<br>
        I'm using an extension to interact with an external system and<br>
        want to<br>
        pass the DeviceID in the provision to the extension. But that line<br>
        above has the effect that the provision (and thus the extension) is<br>
        run twice which is not what one would want.<br>
<br>
<br>
    To be precise, the provision is run twice if another preset is<br>
    executed at the same time, it seems.<br>
<br>
    ______________________________<wbr>_________________<br>
    Users mailing list<br></span>
    <a href="mailto:Users@lists.genieacs.com" target="_blank">Users@lists.genieacs.com</a> <mailto:<a href="mailto:Users@lists.genieacs.com" target="_blank">Users@lists.genieacs.c<wbr>om</a>><br>
    <a href="http://lists.genieacs.com/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.genieacs.com/mail<wbr>man/listinfo/users</a><br>
    <<a href="http://lists.genieacs.com/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.genieacs.com/mai<wbr>lman/listinfo/users</a>><span class=""><br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.genieacs.com" target="_blank">Users@lists.genieacs.com</a><br>
<a href="http://lists.genieacs.com/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.genieacs.com/mail<wbr>man/listinfo/users</a><br>
<br>
</span></blockquote><div class="HOEnZb"><div class="h5">
<br>
______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.genieacs.com" target="_blank">Users@lists.genieacs.com</a><br>
<a href="http://lists.genieacs.com/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.genieacs.com/mail<wbr>man/listinfo/users</a><br>
</div></div></blockquote></div><br></div>