Flexible restieve-sources script; supersedes medic-core version.