bindkeys.pl revision e2ec0753ce8ed53c870141541b34ebb44598cef7
4b01d45a49f1c2cc4bddc9a1b4c78232867de134Andreas Gustafsson#!/usr/bin/env perl
19c7b1a0293498a3e36692c59646ed6e15ffc8d0Tinderbox User#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Copyright (C) 2009-2012, 2014, 2016, 2017 Internet Systems Consortium, Inc. ("ISC")
4b01d45a49f1c2cc4bddc9a1b4c78232867de134Andreas Gustafsson#
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater# This Source Code Form is subject to the terms of the Mozilla Public
4b01d45a49f1c2cc4bddc9a1b4c78232867de134Andreas Gustafsson# License, v. 2.0. If a copy of the MPL was not distributed with this
4b01d45a49f1c2cc4bddc9a1b4c78232867de134Andreas Gustafsson# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4b01d45a49f1c2cc4bddc9a1b4c78232867de134Andreas Gustafsson
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# $Id: bindkeys.pl,v 1.7 2011/01/04 23:47:13 tbox Exp $
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrewsuse strict;
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrewsuse warnings;
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrewsmy $lines;
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrewswhile (<>) {
4b01d45a49f1c2cc4bddc9a1b4c78232867de134Andreas Gustafsson chomp;
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User if (/\/\* .Id:.* \*\//) {
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt next;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt }
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt s/\"/\\\"/g;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt s/$/\\n\\/;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $lines .= $_ . "\n";
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein}
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntmy $mkey = '#define MANAGED_KEYS "\\' . "\n" . $lines . "\"\n";
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
4b01d45a49f1c2cc4bddc9a1b4c78232867de134Andreas Gustafsson$lines =~ s/managed-keys/trusted-keys/;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein$lines =~ s/\s+initial-key//g;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinmy $tkey = '#define TRUSTED_KEYS "\\' . "\n" . $lines . "\"\n";
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinprint $tkey;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinprint "\n";
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinprint $mkey;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein