aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2022-04-17 22:26:33 +0200
committerPatrick Spek <p.spek@tyil.nl>2022-04-17 22:26:33 +0200
commitad62d1da67831c6de287835a1188cead7c3f4ff1 (patch)
tree11531f877529fb2306808d3437d7306df4b21f56 /lib
parent97ea86450b3619cca8a0d562a669f5678d5df168 (diff)
Add a Makefile for easy installation
Diffstat (limited to 'lib')
-rw-r--r--lib/main.bash4
-rw-r--r--lib/subcommands/sync.bash2
-rw-r--r--lib/subcommands/sysinfo.bash3
-rw-r--r--lib/util.bash4
4 files changed, 7 insertions, 6 deletions
diff --git a/lib/main.bash b/lib/main.bash
index 063b05f..851da1d 100644
--- a/lib/main.bash
+++ b/lib/main.bash
@@ -7,7 +7,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/util.bash"
source "$(dirname "${BASH_SOURCE[0]}")/logging.bash"
main() {
- debug "$BASHTARD_NAME/main" "Running from $BASHTARD_BASEDIR"
+ debug "$BASHTARD_NAME/main" "Running from $BASHTARD_LIBDIR"
debug "$BASHTARD_NAME/main" "Configuration dir is at $BASHTARD_ETCDIR"
debug "$BASHTARD_NAME/main" "> $0 $*"
@@ -17,7 +17,7 @@ main() {
debug "$BASHTARD_NAME/main" "Handling subcommand '$BASHTARD_COMMAND'"
- subcommand_src="$BASHTARD_BASEDIR/lib/subcommands/$BASHTARD_COMMAND.bash"
+ subcommand_src="$BASHTARD_LIBDIR/subcommands/$BASHTARD_COMMAND.bash"
debug "$BASHTARD_NAME/main" "Checking $subcommand_src"
diff --git a/lib/subcommands/sync.bash b/lib/subcommands/sync.bash
index af5f282..8fce0b6 100644
--- a/lib/subcommands/sync.bash
+++ b/lib/subcommands/sync.bash
@@ -25,7 +25,7 @@ subcommand()
while read -r playbook
do
info "bashtard/sync" "Syncing $playbook"
- "$BASHTARD_BASEDIR/bin/$BASHTARD_NAME" sync "$playbook"
+ "$BASHTARD_BIN" sync "$playbook"
done < "$BASHTARD_ETCDIR/registry.d/${BASHTARD_PLATFORM[fqdn]}"
}
diff --git a/lib/subcommands/sysinfo.bash b/lib/subcommands/sysinfo.bash
index 5010798..7b83e32 100644
--- a/lib/subcommands/sysinfo.bash
+++ b/lib/subcommands/sysinfo.bash
@@ -1,8 +1,9 @@
#!/usr/bin/env bash
subcommand() {
- printf "%-15s %s\n" "basedir" "$BASHTARD_BASEDIR"
printf "%-15s %s\n" "etcdir" "$BASHTARD_ETCDIR"
+ printf "%-15s %s\n" "libdir" "$BASHTARD_LIBDIR"
+ printf "%-15s %s\n" "sharedir" "$BASHTARD_SHAREDIR"
for key in "${!BASHTARD_PLATFORM[@]}"
do
diff --git a/lib/util.bash b/lib/util.bash
index 72a41a8..98bdc95 100644
--- a/lib/util.bash
+++ b/lib/util.bash
@@ -38,8 +38,8 @@ config_for() {
fi
files+=(
- "$BASHTARD_BASEDIR/etc/os.d/${BASHTARD_PLATFORM[key]}"
- "$BASHTARD_BASEDIR/etc/defaults"
+ "$BASHTARD_SHAREDIR/os.d/${BASHTARD_PLATFORM[key]}"
+ "$BASHTARD_SHAREDIR/defaults"
)
# Check configuration files