diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | build.sh | 10 | ||||
-rw-r--r-- | ddtools.spec | 57 | ||||
-rw-r--r-- | files-for-versioning.txt | 2 | ||||
-rwxr-xr-x | old/pack (renamed from usr/share/ddtools/build/pack) | 0 | ||||
-rw-r--r-- | src/etc/bash_completion.d/updatezone (renamed from etc/bash_completion.d/updatezone) | 0 | ||||
-rw-r--r-- | src/etc/ddtools/ipa.example.com.conf.example (renamed from usr/share/ddtools/examples/ipa.smith122.com.conf.example) | 6 | ||||
-rw-r--r-- | src/etc/sysconfig/dhcpd-control (renamed from etc/sysconfig/dhcpd-control) | 0 | ||||
-rwxr-xr-x | src/usr/bin/dhcpd-control (renamed from usr/share/ddtools/dhcpd-control.sh) | 10 | ||||
-rwxr-xr-x | src/usr/bin/updatezone (renamed from usr/share/ddtools/updatezone.sh) | 6 | ||||
-rw-r--r-- | src/usr/share/doc/ddtools/README.txt (renamed from usr/share/doc/ddtools/README.txt) | 3 | ||||
-rw-r--r-- | src/usr/share/doc/ddtools/version.txt | 1 | ||||
l--------- | usr/bin/dhcpd-control | 1 | ||||
l--------- | usr/bin/updatezone | 1 | ||||
-rw-r--r-- | usr/share/ddtools/build/ddtools.spec | 65 | ||||
-rw-r--r-- | usr/share/ddtools/build/files-for-versioning.txt | 3 | ||||
-rwxr-xr-x | usr/share/ddtools/build/get-files | 40 | ||||
l--------- | usr/share/ddtools/doc | 1 | ||||
-rw-r--r-- | usr/share/doc/ddtools/version.txt | 1 |
19 files changed, 87 insertions, 121 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a01ee28 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.*.swp diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..95637fe --- /dev/null +++ b/build.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# Startdate: 2024-08-19-2 10:46 +# Yet a new build.sh style. + +thisdir="$( dirname "$( readlink -f "${0}" )" )" +thisdir_short="$( basename "${thisdir}" )" +cd "${thisdir}" +rm -f ~/rpmbuild/SOURCES/ddtools.tgz +tar -zcf ~/rpmbuild/SOURCES/ddtools.tgz -C .. "${thisdir_short}" +rpmbuild -ba ddtools.spec diff --git a/ddtools.spec b/ddtools.spec new file mode 100644 index 0000000..9300d2a --- /dev/null +++ b/ddtools.spec @@ -0,0 +1,57 @@ +# ref: http://www.rpm.org/max-rpm/s1-rpm-build-creating-spec-file.html +Summary: suite of scripts for managing dns and dhcpd +Name: ddtools +Version: 0.0.4 +Release: 1 +License: CC BY-SA 4.0 +Group: Applications/System +Source: ddtools.tgz +URL: https://bgstack15.wordpress.com/ +Packager: B. Stack <bgstack15@gmail.com> +Requires: bgscripts-core >= 1.4.0 +Obsoletes: updatezone <= %{version}-%{release} +Buildarch: noarch + +%description +ddtools provides shell scripts that help manage dns and dhcpd. +updatezone takes a simple config file for selecting the dns zone files to edit. Bind is the only supported dns server right now, but experimentation is encouraged. +dhcpd-control helps manage paired dhcpd servers. + +#%global _python_bytecompile_errors_terminate_build 0 + +%prep +%setup + +%build + +%install +rm -rf %{buildroot} +rsync -a ./src/ %{buildroot}/ --exclude='**/.*.swp' --exclude='**/.git' + +%post +exit 0 + +%preun +exit 0 + +%postun +exit 0 + +%files +%dir %{_datadir}/ddtools +%dir %{_sysconfdir}/ddtools +%{_sysconfdir}/ddtools/* +%{_bindir}/* +%{_docdir}/ddtools/* +%{_sysconfdir}/bash_completion.d/* +%{_sysconfdir}/sysconfig/* + +%changelog +* Mon Aug 19 2024 B. Stack <bgstack15@gmail.com> - 0.0.4-1 +- Small config choices for modern era + +* Sun Oct 15 2017 B Stack <bgstack15@gmail.com> 0.0-3 +- Updated content. See doc/README.txt + +* Sat May 27 2017 B Stack <bgstack15@gmail.com> 0.0-1 +- Initial rpm release diff --git a/files-for-versioning.txt b/files-for-versioning.txt new file mode 100644 index 0000000..10f087a --- /dev/null +++ b/files-for-versioning.txt @@ -0,0 +1,2 @@ +ddtools.spec +src/usr/share/doc/ddtools/README.txt diff --git a/usr/share/ddtools/build/pack b/old/pack index c8ebd6c..c8ebd6c 100755 --- a/usr/share/ddtools/build/pack +++ b/old/pack diff --git a/etc/bash_completion.d/updatezone b/src/etc/bash_completion.d/updatezone index f55d1ce..f55d1ce 100644 --- a/etc/bash_completion.d/updatezone +++ b/src/etc/bash_completion.d/updatezone diff --git a/usr/share/ddtools/examples/ipa.smith122.com.conf.example b/src/etc/ddtools/ipa.example.com.conf.example index 9f74dd8..060005a 100644 --- a/usr/share/ddtools/examples/ipa.smith122.com.conf.example +++ b/src/etc/ddtools/ipa.example.com.conf.example @@ -1,6 +1,6 @@ -UZ_ZONE_NAME=ipa.smith122.com -UZ_FORWARD_ZONE=ipa.smith122.com -UZ_FORWARD_FILE=/var/named/data/db.ipa.smith122.com +UZ_ZONE_NAME=ipa.example.com +UZ_FORWARD_ZONE=ipa.example.com +UZ_FORWARD_FILE=/var/named/data/db.ipa.example.com UZ_REVERSE_ZONE=1.168.192.in-addr.arpa UZ_REVERSE_FILE=/var/named/data/db.192.168.1 UZ_SLAVE_COUNT=1 diff --git a/etc/sysconfig/dhcpd-control b/src/etc/sysconfig/dhcpd-control index 3073169..3073169 100644 --- a/etc/sysconfig/dhcpd-control +++ b/src/etc/sysconfig/dhcpd-control diff --git a/usr/share/ddtools/dhcpd-control.sh b/src/usr/bin/dhcpd-control index 843e79a..7ee4e0a 100755 --- a/usr/share/ddtools/dhcpd-control.sh +++ b/src/usr/bin/dhcpd-control @@ -7,6 +7,7 @@ # Purpose: Provides a single command for would take a series of steps # Package: ddtools # History: +# 2024-08-19 fix framework path # Usage: # Reference: ftemplate.sh 2017-05-24a; framework.sh 2017-05-24a # order of dhcpd servers to restart https://kb.isc.org/article/AA-01043/0/Recommendations-for-restarting-a-DHCP-failover-pair.html @@ -18,7 +19,7 @@ # Dependencies: # systemd fiversion="2017-05-24a" -dhcpdcontrolversion="2017-05-29b" +dhcpdcontrolversion="2024-08-19a" usage() { less -F >&2 <<ENDUSAGE @@ -100,6 +101,7 @@ ${scriptdir}/framework.sh /usr/bin/framework.sh /bin/bgscripts/framework.sh /usr/share/bgscripts/framework.sh +/usr/libexec/bgscripts/framework.sh EOFLOCATIONS test -z "${frameworkscript}" && echo "$0: framework not found. Aborted." 1>&2 && exit 4 @@ -315,7 +317,7 @@ trap "clean_dhcpdcontrol" 0 if ! cmp -s "${DHCPD_CONTROL_COMBINED_FILE}" "${tmp_dhcpd_combined_file}"; then debuglev 1 && ferror "Updating dhcpd combined file." - /usr/share/bgscripts/bup.sh "${DHCPD_CONTROL_COMBINED_FILE}" + bup "${DHCPD_CONTROL_COMBINED_FILE}" cp -p "${tmp_dhcpd_combined_file}" "${DHCPD_CONTROL_COMBINED_FILE}" update_conf_other=1 restart_service_local=1 @@ -333,7 +335,7 @@ trap "clean_dhcpdcontrol" 0 if ! cmp -s "${DHCPD_CONTROL_DHCPD_FILE}" "${tmp_dhcpd_local_file}"; then debuglev 1 && ferror "Updating local dhcpd file." - /usr/share/bgscripts/bup.sh "${DHCPD_CONTROL_DHCPD_FILE}" + bup "${DHCPD_CONTROL_DHCPD_FILE}" cp -p "${tmp_dhcpd_local_file}" "${DHCPD_CONTROL_DHCPD_FILE}" restart_service_local=1 fi @@ -348,7 +350,7 @@ trap "clean_dhcpdcontrol" 0 if ! cmp -s "${tmp_dhcpd_other_file}" "${tmp_dhcpd_other_file}8"; then debuglev 1 && ferror "Updating other server dhcpd file." - ssh "${DHCPD_CONTROL_OTHER_SERVER}" /usr/share/bgscripts/bup.sh "${DHCPD_CONTROL_DHCPD_FILE}"; + ssh "${DHCPD_CONTROL_OTHER_SERVER}" bup "${DHCPD_CONTROL_DHCPD_FILE}"; scp -p "${tmp_dhcpd_other_file}8" "${DHCPD_CONTROL_OTHER_SERVER}:${DHCPD_CONTROL_DHCPD_FILE}"; restart_service_other=1 fi diff --git a/usr/share/ddtools/updatezone.sh b/src/usr/bin/updatezone index 6dc17bd..dc6efde 100755 --- a/usr/share/ddtools/updatezone.sh +++ b/src/usr/bin/updatezone @@ -8,6 +8,7 @@ # Package: updatezone # History: # 2017-10-15 Added --flush option +# 2024-08-19 fix typo in tmp_rev_file2 # Usage: # Primarily intended for updating forward and reverse zones for bind9. # Reference: ftemplate.sh 2017-05-24a; framework.sh 2017-05-24a @@ -17,7 +18,7 @@ # ssh with password-less authentication to slave servers # each zone file has only a single zone fiversion="2017-05-24a" -updatezoneversion="2017-10-15b" +updatezoneversion="2024-08-19a" usage() { less -F >&2 <<ENDUSAGE @@ -176,6 +177,7 @@ ${scriptdir}/framework.sh /usr/bin/framework.sh /bin/bgscripts/framework.sh /usr/share/bgscripts/framework.sh +/usr/libexec/bgscripts/framework.sh EOFLOCATIONS test -z "${frameworkscript}" && echo "$0: framework not found. Aborted." 1>&2 && exit 4 @@ -350,7 +352,7 @@ main_action() { # flush forward records grep -v -f "${tmp_flush_for_file}" "${tmp_for_file}" > "${tmp_for_file}2"; mv -f "${tmp_for_file}2" "${tmp_for_file}" # flush reverse records - grep -v -E -f "${tmp_flush_rev_file}" "${tmp_rev_file}" > "{tmp_rev_file}2"; mv -f "${tmp_rev_file}2" "${tmp_rev_file}" + grep -v -E -f "${tmp_flush_rev_file}" "${tmp_rev_file}" > "${tmp_rev_file}2"; mv -f "${tmp_rev_file}2" "${tmp_rev_file}" ;; esac diff --git a/usr/share/doc/ddtools/README.txt b/src/usr/share/doc/ddtools/README.txt index 9a6b5d9..747eee1 100644 --- a/usr/share/doc/ddtools/README.txt +++ b/src/usr/share/doc/ddtools/README.txt @@ -56,3 +56,6 @@ updatezone --flush ipa.smith122.com - Rearranged directory structure to match current standards - Added bash autocompletion definition for updatezone - Added --flush to updatezone to match dhcpd-control + +2024-08-19 B. Stack <bgstack15@gmail.com> - 0.0.4-1 +- Rearranged directory structure to match current standards diff --git a/src/usr/share/doc/ddtools/version.txt b/src/usr/share/doc/ddtools/version.txt new file mode 100644 index 0000000..81340c7 --- /dev/null +++ b/src/usr/share/doc/ddtools/version.txt @@ -0,0 +1 @@ +0.0.4 diff --git a/usr/bin/dhcpd-control b/usr/bin/dhcpd-control deleted file mode 120000 index 2eb517b..0000000 --- a/usr/bin/dhcpd-control +++ /dev/null @@ -1 +0,0 @@ -../share/ddtools/dhcpd-control.sh
\ No newline at end of file diff --git a/usr/bin/updatezone b/usr/bin/updatezone deleted file mode 120000 index bbe52a3..0000000 --- a/usr/bin/updatezone +++ /dev/null @@ -1 +0,0 @@ -../share/ddtools/updatezone.sh
\ No newline at end of file diff --git a/usr/share/ddtools/build/ddtools.spec b/usr/share/ddtools/build/ddtools.spec deleted file mode 100644 index d5590ef..0000000 --- a/usr/share/ddtools/build/ddtools.spec +++ /dev/null @@ -1,65 +0,0 @@ -# ref: http://www.rpm.org/max-rpm/s1-rpm-build-creating-spec-file.html -Summary: suite of scripts for managing dns and dhcpd -Name: ddtools -Version: 0.0 -Release: 3 -License: CC BY-SA 4.0 -Group: Applications/System -Source: ddtools.tgz -URL: https://bgstack15.wordpress.com/ -#Distribution: -#Vendor: -Packager: B Stack <bgstack15@gmail.com> -Requires: bgscripts-core >= 1.2-11 -Obsoletes: updatezone <= %{version}-%{release} -Buildarch: noarch - -%description -ddtools provides shell scripts that help manage dns and dhcpd. -updatezone.sh takes a simple config file for selecting the dns zone files to edit. Bind is the only supported dns server right now, but experimentation is encouraged. -dhcpd-control helps manage paired dhcpd servers. - -#%global _python_bytecompile_errors_terminate_build 0 - -%prep -%setup - -%build - -%install -rm -rf %{buildroot} -rsync -a . %{buildroot}/ --exclude='**/.*.swp' --exclude='**/.git' - -%post -exit 0 - -%preun -exit 0 - -%postun -exit 0 - -%files -%dir /etc/ddtools -%dir /usr/share/ddtools -/etc/sysconfig/dhcpd-control -/etc/bash_completion.d/updatezone -%config %attr(666, -, -) /usr/share/ddtools/examples/ipa.smith122.com.conf.example -/usr/share/ddtools/dhcpd-control.sh -/usr/share/ddtools/build/get-files -%doc %attr(444, -, -) /usr/share/ddtools/build/files-for-versioning.txt -/usr/share/ddtools/build/pack -/usr/share/ddtools/build/ddtools.spec -/usr/share/ddtools/doc -/usr/share/ddtools/updatezone.sh -%doc %attr(444, -, -) /usr/share/doc/ddtools/version.txt -%doc %attr(444, -, -) /usr/share/doc/ddtools/README.txt -%verify(link) /usr/bin/updatezone -%verify(link) /usr/bin/dhcpd-control - -%changelog -* Sun Oct 15 2017 B Stack <bgstack15@gmail.com> 0.0-3 -- Updated content. See doc/README.txt - -* Sat May 27 2017 B Stack <bgstack15@gmail.com> 0.0-1 -- Initial rpm release diff --git a/usr/share/ddtools/build/files-for-versioning.txt b/usr/share/ddtools/build/files-for-versioning.txt deleted file mode 100644 index 00edf00..0000000 --- a/usr/share/ddtools/build/files-for-versioning.txt +++ /dev/null @@ -1,3 +0,0 @@ -doc/README.txt -doc/version.txt -build/ddtools.spec diff --git a/usr/share/ddtools/build/get-files b/usr/share/ddtools/build/get-files deleted file mode 100755 index 3302cc5..0000000 --- a/usr/share/ddtools/build/get-files +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# File: get-files -case "${1}" in - rpm) -if test -n "${package}"; then cd ${rpmbuilddir}/SOURCES/"${package}-${version}"; else cd $( pwd | sed -r -e 's/(SOURCES\/[^\/]+\/).*/\1/;' ); fi - -### for rpm -find * -type d -regextype grep \ - \( -regex 'usr\/share\/ddtools*' -o -regex 'etc\/ddtools*' \) \ - ! -regex '.*gui.*' \ - | sed -e 's/^/%dir \//;' -find * -mindepth 1 ! -name "${package}.spec.$$.swp" \ - ! -type d -regextype grep \ - ! -regex '.*.swp' \ - ! -regex '.*DEBIAN.*' \ - | sed -r -e ' -s/^/\//; -s/(.*\.txt)/%doc %attr(444, -, -) \1/; -s/(.*bin.*)/%verify(link) \1/; -s/(.*)\.py$/\1\.py\n\1\.pyc\n\1\.pyo/; -s/(.*\.conf)/%config %attr(666, -, -) \1/; -s/(\/usr)?\/lib\/systemd\/system\/(.*)/%{_unitdir}\/\2/; -' - - ;; - deb) - -### for deb -find . -mindepth 1 ! -name "${package}.spec\.$$\.swp" \ - ! -type d -regextype grep \ - ! -regex '.*hg.*' ! -regex '.*?debian-binary.*' \ - ! -regex '.*DEBIAN.*' ! -regex '.*\.swp' ! -regex '.*\.git.*' ! -name 'README.md' \ - -printf '%P ' - - ;; - *) - echo "FATAL ERROR: check ./pack or get-files-core. Please use [ rpm | deb ] option. Aborted." 1>&2 - exit 1 - ;; -esac diff --git a/usr/share/ddtools/doc b/usr/share/ddtools/doc deleted file mode 120000 index 6aac6fe..0000000 --- a/usr/share/ddtools/doc +++ /dev/null @@ -1 +0,0 @@ -../doc/ddtools
\ No newline at end of file diff --git a/usr/share/doc/ddtools/version.txt b/usr/share/doc/ddtools/version.txt deleted file mode 100644 index eb8d937..0000000 --- a/usr/share/doc/ddtools/version.txt +++ /dev/null @@ -1 +0,0 @@ -0.0-3 |