osx - Why Shell script randomly stops fetching password from Keychain? -


i fetching password keychain using below command

login_name=`security find-generic-password -l 'main_screen' -a first_screen_user -w` 

it fetches results without problem. have seen if not restart laptop 2-3 weeks. stop returning value. there particular reason , how make work time.

what see when 'stops returning value'? try running -v more info.

one thing took me while discover keychains can lock after timeout or 'sleep':

run keychain access, right click on keychain use, , select change settings keychain .... see if of lock after x minutes of inactivity or lock when sleeping checkboxes selected.

if 1 or 2 selected, can either uncheck them, or make sure run security unlock-keychain , repeating command if no value.


Comments