Using KPScript to update expiry times

2014-04-09
2014-04-09
  • todd hargett

    todd hargett - 2014-04-09

    trying to figure out a way to update all my ssh passwords, that have expired, automatically.
    i have written a bash script that works using cygwin but i'm stuck on updating the expiry times.

    i'm currently trying to get to the expiry times with:

    ~/KPScript.exe -c:EditEntry "~\MYDB.kdbx" -keyfile:"\~MYKEY.key" -ref-Title:"server" -set-Expiry Time:"2014-06-09T07:00:00Z"

    Can't get it working any help?!

     
  • Paul

    Paul - 2014-04-09

    Try "ExpiryTime", without a space. That's how it shows in the export.

    cheers, Paul

     
  • todd hargett

    todd hargett - 2014-04-09

    i've tried Expirey, Expires, ExpireyTime, and a few other combos but when i add something adds new key to the database or so it looks like in the xml output.

    < String>
    <Key>expire< /Key>
    <Value>6/9/2014< /Value>
    < /String>
    < String>
    < Key>expires< /Key>
    < Value>2014-06-09T07:00:00Z< /Value>
    < /String>
    < String>
    < Key>expirytime< /Key>
    < Value>2014-06-09T07:00:00Z< /Value>
    < /String>

     
  • Paul

    Paul - 2014-04-09

    That field is not a string and it seems there is no set command for those.
    You could try XML Replace - unfortunately not a command line option.
    http://keepass.info/help/v2/xml_replace.html

    cheers, Paul

     
    Last edit: Paul 2014-04-09
  • Dominik Reichl

    Dominik Reichl - 2014-04-09

    The 'EditEntry' command together with '-set-S:V' sets the string field S to the value V. It cannot be used to set non-string fields like the expiry time.

    I've now added parameters '-setx-Expires:V' and '-setx-ExpiryTime:V', which you can use to set the expiry time. Updated documentation:
    http://keepass.info/help/v2_dev/scr_sc_index.html

    Here's the latest KPScript development snapshot for testing:
    http://keepass.info/filepool/KPScript_140409.zip

    Thanks and best regards,
    Dominik

     
  • todd hargett

    todd hargett - 2014-04-09

    nice! i'll check that out right now, thank you dominik and paul that's what i was getting ready to play around with but if there is away to do it with the kpscript i would much rather use that just so i can cut out as much work as possible, scripting is all about making my job easier... so i can be lazy haha

     
  • todd hargett

    todd hargett - 2014-04-09

    Dominik it works perfectly thanks so much for that :)

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks