actually set the vars ok

This commit is contained in:
Jack L. Frost 2015-08-17 13:36:49 +03:00
parent f2c19a6996
commit 6ef5f62d75
3 changed files with 11 additions and 4 deletions

7
config.mk.sh Normal file
View File

@ -0,0 +1,7 @@
# make.sh config
PREFIX=${PREFIX:-/}
USR=${USR:-"${PREFIX}usr/local"}
BINDIR=${BINDIR:-"${DESTDIR}${USR}/bin"}
LOGDIR=${LOGDIR:-"/tmp/userrc"}
CONFIG=${CONFIG:-"/etc/userrc.conf"}

View File

@ -7,7 +7,7 @@ set_vars() {
sed -r \ sed -r \
-e "s%@CONFIG@%${CONFIG}%" \ -e "s%@CONFIG@%${CONFIG}%" \
-r "s%@LOGDIR@%${LOGDIR}%" -e "s%@LOGDIR@%${LOGDIR}%"
} }
do_tell() { do_tell() {
@ -17,7 +17,7 @@ do_tell() {
# Targets # Targets
target_userrc() { target_userrc() {
declare target='userrc' target='userrc'
printf '%s\n' "Building $target..." printf '%s\n' "Building $target..."
set_vars < "$target".in > "$target" set_vars < "$target".in > "$target"

View File

@ -67,8 +67,8 @@ get_allowed_users() {
} }
runtime_config() { runtime_config() {
config='/etc/userrc.conf' config='@CONFIG@'
cfg_logdir='/tmp/userrc' cfg_logdir='@LOGDIR@'
while (( $# )); do while (( $# )); do
case "$1" in case "$1" in