summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rwxr-xr-xsrc/utils/add-config-sync-exclude-paths.py29
-rwxr-xr-xsrc/utils/vyos-commands-to-config2
-rwxr-xr-xsrc/utils/vyos-config-file-query2
-rwxr-xr-xsrc/utils/vyos-hostsd-client2
-rwxr-xr-xsrc/utils/vyos-show-config2
5 files changed, 33 insertions, 4 deletions
diff --git a/src/utils/add-config-sync-exclude-paths.py b/src/utils/add-config-sync-exclude-paths.py
new file mode 100755
index 000000000..54a209490
--- /dev/null
+++ b/src/utils/add-config-sync-exclude-paths.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python3
+
+import sys
+import json
+import argparse
+
+parser = argparse.ArgumentParser()
+parser.add_argument('--file', default='data/config-sync-exclude.json')
+parser.add_argument('--paths', nargs='+')
+
+args = parser.parse_args()
+paths = args.paths
+file = args.file
+
+try:
+ with open(file) as f:
+ exclude_str = json.load(f)
+except FileNotFoundError:
+ print(f'Adding new file: {file}')
+ exclude_str = []
+except json.JSONDecodeError as e:
+ sys.exit(e)
+
+for path in (paths or []):
+ exclude_str.append(path.split())
+
+with open(file, 'w') as f:
+ json.dump(exclude_str, f, indent=1)
+ f.write('\n')
diff --git a/src/utils/vyos-commands-to-config b/src/utils/vyos-commands-to-config
index 927d9bd70..54dd4e9fa 100755
--- a/src/utils/vyos-commands-to-config
+++ b/src/utils/vyos-commands-to-config
@@ -1,6 +1,6 @@
#! /usr/bin/python3
#
-# Copyright (C) 2024 VyOS maintainers and contributors
+# Copyright VyOS maintainers and contributors <maintainers@vyos.io>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
diff --git a/src/utils/vyos-config-file-query b/src/utils/vyos-config-file-query
index a10c7e9b3..2673fc487 100755
--- a/src/utils/vyos-config-file-query
+++ b/src/utils/vyos-config-file-query
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2019 VyOS maintainers and contributors
+# Copyright VyOS maintainers and contributors <maintainers@vyos.io>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
diff --git a/src/utils/vyos-hostsd-client b/src/utils/vyos-hostsd-client
index a0515951a..937e657ff 100755
--- a/src/utils/vyos-hostsd-client
+++ b/src/utils/vyos-hostsd-client
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2019 VyOS maintainers and contributors
+# Copyright VyOS maintainers and contributors <maintainers@vyos.io>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
diff --git a/src/utils/vyos-show-config b/src/utils/vyos-show-config
index 152322fc1..703b0ac9a 100755
--- a/src/utils/vyos-show-config
+++ b/src/utils/vyos-show-config
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-# Copyright (C) 2024 VyOS maintainers and contributors
+# Copyright VyOS maintainers and contributors <maintainers@vyos.io>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as