Skip to content

Instantly share code, notes, and snippets.

@rich123
Created October 4, 2012 01:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rich123/3830921 to your computer and use it in GitHub Desktop.
Save rich123/3830921 to your computer and use it in GitHub Desktop.
Password Safe Convert
namespace eval gorilla { variable Dir [ pwd ] }
lappend auto_path [ pwd ]
package require pwsafe
interp alias {} mc {} puts
if { [ llength $argv ] != 2 } {
puts "Usage: $argv0 input-file output-file"
exit 1
}
lassign $argv inf outf
if { ! [ file isfile $inf ] } {
puts "Error: input-file '$inf' does not exist, aborting."
exit 1
}
if { [ file exists $outf ] } {
puts "Error: output-file '$outf' exists, refusing to overwrite."
exit 1
}
puts stderr "Enter Password"
gets stdin password
set newdb [ pwsafe::createFromFile $inf $password ]
pwsafe::writeToFile $newdb $outf 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment