From 9267d2f1fa3fbbddbed38e9c78338cd60603cce7 Mon Sep 17 00:00:00 2001 From: Mark Grant Date: Mon, 16 Oct 2023 15:06:58 +0100 Subject: [PATCH] bash: man: Drop .sh extension from scripts in $PATH The normal convention is that executables in $PATH do not have an extension. This is to allow a re-write in a different language without affecting the user. Signed-off-by: Mark Grant --- src/man/8/Makefile.am | 14 ++++++++------ src/man/8/{dosab.sh.8.man.in => dosab.8.man.in} | 6 +++--- src/prg/bash/Makefile.am | 16 +++++++++------- src/prg/bash/dosab.sh.in | 12 +++++++----- src/systemd/dosab.service.in | 4 ++-- 5 files changed, 29 insertions(+), 23 deletions(-) rename src/man/8/{dosab.sh.8.man.in => dosab.8.man.in} (88%) diff --git a/src/man/8/Makefile.am b/src/man/8/Makefile.am index 2182215..245694d 100644 --- a/src/man/8/Makefile.am +++ b/src/man/8/Makefile.am @@ -1,7 +1,7 @@ ######################################################################### # # # Script ID: src/man/8/Makefile.am # -# Author: Copyright (C) 2018-2019, 2021 Mark Grant # +# Author: Copyright (C) 2018-2019, 2021, 2023 Mark Grant # # # # Released under the GPLv3 only. # # SPDX-License-Identifier: GPL-3.0-only # @@ -20,11 +20,13 @@ # 27/09/2018 MG 1.0.1 Initial release. # # 20/04/2019 MG 1.0.2 Remove shebang. # # 26/11/2021 MG 1.0.3 Tighten SPDX tag. # +# 16/10/2023 MG 1.0.4 Drop .sh extension from scripts in # +# $PATH. # # # ######################################################################### -dosab.sh.8: Makefile +dosab.8: Makefile mkdir -p $(@D) rm -f $@ $@.tmp $(edit) $(srcdir)/$(@F).man.in > $@.tmp @@ -44,10 +46,10 @@ dosab.sh.8: Makefile $@.tmp $@ rm -f $@.tmp -dosab.sh.8: $(srcdir)/dosab.sh.8.man.in +dosab.8: $(srcdir)/dosab.8.man.in -man_MANS = dosab.sh.8 +man_MANS = dosab.8 -EXTRA_DIST = $(srcdir)/dosab.sh.8.man.in +EXTRA_DIST = $(srcdir)/dosab.8.man.in -CLEANFILES = *.tmp dosab.sh.8 +CLEANFILES = *.tmp dosab.8 diff --git a/src/man/8/dosab.sh.8.man.in b/src/man/8/dosab.8.man.in similarity index 88% rename from src/man/8/dosab.sh.8.man.in rename to src/man/8/dosab.8.man.in index 449158b..ba109bc 100644 --- a/src/man/8/dosab.sh.8.man.in +++ b/src/man/8/dosab.8.man.in @@ -1,7 +1,7 @@ NAME -dosab.sh - Take action depending on server availability during boot. +dosab - Take action depending on server availability during boot. SYNOPSIS -dosab.sh [OPTION] +dosab [OPTION] DESCRIPTION This script reads a list of servers from the config file server.list and determines whether they are contactable. If they are, commands stored in the @@ -25,7 +25,7 @@ Written by Mark Grant. REPORTING BUGS Report bugs to COPYRIGHT -Copyright 2018, 2021 Mark Grant. +Copyright 2018, 2021, 2023 Mark Grant. .br License GPLv3: GNU GPL version 3 only .br diff --git a/src/prg/bash/Makefile.am b/src/prg/bash/Makefile.am index 77cc812..0884502 100644 --- a/src/prg/bash/Makefile.am +++ b/src/prg/bash/Makefile.am @@ -1,13 +1,13 @@ ######################################################################### # # # Script ID: src/prg/bash/Makefile.am # -# Author: Copyright (C) 2018-2019, 2021 Mark Grant # +# Author: Copyright (C) 2018-2019, 2021, 2023 Mark Grant # # # # Released under the GPLv3 only. # # SPDX-License-Identifier: GPL-3.0-only # # # # Purpose: # -# AutoMake script file to generate dosab.sh script from source. # +# AutoMake script file to generate dosab script from source. # # # ######################################################################### @@ -21,6 +21,8 @@ # 20/04/2019 MG 1.0.2 Remove shebang. # # 24/08/2021 MG 1.0.3 Correct systemd action ordering. # # 26/11/2021 MG 1.0.4 Tighten SPDX tag. # +# 16/10/2023 MG 1.0.5 Drop .sh extension from scripts in # +# $PATH. # # # ######################################################################### @@ -33,17 +35,17 @@ ######################################################################### -dosab.sh: Makefile +dosab: Makefile mkdir -p $(@D) rm -f $@ $@.tmp test -f ./$@.in || srcdir=$(srcdir)/; \ - $(edit) $${srcdir}$(@F).in > $@.tmp + $(edit) $${srcdir}$(@F).sh.in > $@.tmp mv $@.tmp $@ chmod a+x $@ -dosab.sh: $(srcdir)/dosab.sh.in +dosab: $(srcdir)/dosab.sh.in -sbin_SCRIPTS = dosab.sh +sbin_SCRIPTS = dosab # systemd requires some ordering of it's actions. Please refer to the comment in @@ -56,5 +58,5 @@ endif EXTRA_DIST = $(srcdir)/dosab.sh.in -CLEANFILES = *.tmp dosab.sh +CLEANFILES = *.tmp dosab diff --git a/src/prg/bash/dosab.sh.in b/src/prg/bash/dosab.sh.in index e547de3..cf321f6 100644 --- a/src/prg/bash/dosab.sh.in +++ b/src/prg/bash/dosab.sh.in @@ -1,15 +1,15 @@ #! @bashlocation@ ######################################################################### # # -# dosab.sh is automatically generated, # +# dosab is automatically generated, # # please do not modify! # # # ######################################################################### ######################################################################### # # -# Script ID: dosab.sh # -# Author: Copyright (C) 2018-2019, 2021 Mark Grant # +# Script ID: dosab # +# Author: Copyright (C) 2018-2019, 2021, 2023 Mark Grant # # # # Released under the GPLv3 only. # # SPDX-License-Identifier: GPL-3.0-only # @@ -18,7 +18,7 @@ # To determine if a server is contactable and conditional on that, # # execute stored commands. # # # -# Syntax: dosab.sh [ -h --help || -V --version ] # +# Syntax: dosab [ -h --help || -V --version ] # # # # Exit codes used:- # # Bash standard Exit Codes: 0 - success # @@ -75,6 +75,8 @@ # used. # # Move script_exit() before it is used. # # 26/11/2021 MG 1.1.4 Tighten SPDX tag. # +# 16/10/2023 MG 1.2.0 Drop .sh extension from scripts in # +# $PATH. # # # ######################################################################### @@ -84,7 +86,7 @@ ################## readonly outputprefix="$(basename $0):" -readonly version=1.1.4 # Script version +readonly version=1.2.0 # Script version readonly etclocation=@sysconfdir@/dosab # Path to etc directory readonly packageversion=@pkgversion@ # Package version diff --git a/src/systemd/dosab.service.in b/src/systemd/dosab.service.in index 6f559e2..d7f82f4 100644 --- a/src/systemd/dosab.service.in +++ b/src/systemd/dosab.service.in @@ -1,13 +1,13 @@ [Unit] Description=Dependency On Server At Boot -Documentation=man:dosab.sh(8) +Documentation=man:dosab(8) After=network-online.target remote-fs.target Wants=network-online.target [Service] Type=exec -ExecStart=@sbindir@/dosab.sh +ExecStart=@sbindir@/dosab Restart=no [Install]