ip hotspot user password change script

/ system script add name=“test” source={
/ip hotspot user print
/ip hotspot user set 0 password=pink
}

when I run the test script it does not change the password, what have I got wrong in the script?

thanks

You can’t user item numbers in scripts - this has been covered numerous times here in the forum. To reference an entry in a script you have to use the “find” command in your script - search the forum and/or manual for lots of examples.

Best regards,
Christian Meis

thanks

Just found this thread while trying to do the very same thing - so in the interest of more complete research facilities:

On 2.9.20, if your user is ‘user1’, then the script line is:

/ system script add name=“test” source={
/ip hotspot user set user1 password=pink
}

B)