Skip to content

Commit

Permalink
Substitute PREFIX in rc.d/dynamic_motd
Browse files Browse the repository at this point in the history
  • Loading branch information
sstallion committed Oct 29, 2022
1 parent c0ebe76 commit c0a1856
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/rc.d/dynamic_motd
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ CONFRCD= rc.d/dynamic_motd
CONFRCDDIR= ${CONFDIR}/rc.d
CONFRCDMODE= ${BINMODE}

CLEANFILES= rc.d/dynamic_motd
PREFIX_SUB= -e 's,@@PREFIX@@,${PREFIX},g'

rc.d/dynamic_motd: rc.d/dynamic_motd.in
sed ${PREFIX_SUB} ${.ALLSRC} >${.TARGET}

beforeinstall: installdirs
afterinstall: installconfig

Expand Down
4 changes: 2 additions & 2 deletions rc.d/dynamic_motd → rc.d/dynamic_motd.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ desc="Dynamic /var/run/motd"
rcvar="${name}"

set_rcvar dynamic_motd "NO"
set_rcvar motd_script "/usr/local/etc/rc.motd"
set_rcvar motd_script "@@PREFIX@@/etc/rc.motd"

load_rc_config $name

command="/usr/local/libexec/${name}"
command="@@PREFIX@@/libexec/${name}"
command_args="${motd_script}"
command_interpreter="/bin/sh"
start_precmd="${name}_prestart"
Expand Down

0 comments on commit c0a1856

Please sign in to comment.