feat: Adds customer share mount to runs/after/system

This commit is contained in:
2025-11-18 10:48:47 -05:00
parent 8daa596205
commit 4b674c40c9
3 changed files with 23 additions and 9 deletions

View File

@@ -22,15 +22,20 @@ SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
############################## MAIN ##############################
last_pull="0"
if [[ -f "$HPA_CONFIG_DIR/.lastpull" ]]; then
last_pull=$(cat "$HPA_CONFIG_DIR/.lastpull")
fi
curr=$(date +%s)
diff=$((curr - last_pull))
# Don't pull images if they're prefixed with 'localhost'.
if echo "$HPA_DOCKER_IMAGE" | grep -vq "localhost"; then
if [[ $HPA_AUTO_PULL == "1" ]] && [[ $diff -gt "$HPA_AUTO_PULL_INTERVAL" ]]; then
. "$SCRIPTS/hpa-pull" "$HPA_AUTO_PULL_OPTS"
# Check if we should pull the image prior to running.
last_pull="0"
if [[ -f "$HPA_CONFIG_DIR/.lastpull" ]]; then
last_pull=$(cat "$HPA_CONFIG_DIR/.lastpull")
fi
curr=$(date +%s)
diff=$((curr - last_pull))
if [[ $HPA_AUTO_PULL == "1" ]] && [[ $diff -gt "$HPA_AUTO_PULL_INTERVAL" ]]; then
. "$SCRIPTS/hpa-pull" "$HPA_AUTO_PULL_OPTS"
fi
fi
podman run --rm --interactive --tty \

View File

@@ -12,7 +12,7 @@ XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
# Docker vars.
HPA_DOCKER_IMAGE="git.housh.dev/michael/swift-hpa"
HPA_DOCKER_IMAGE=${HPA_DOCKER_IMAGE:-"git.housh.dev/michael/swift-hpa"}
HPA_DOCKER_TAG=${HPA_DOCKER_TAG:-"latest"}
# Auto pull options to be ran before running the hpa docker

View File

@@ -18,6 +18,15 @@ _setup-mounts() {
sudo mount -a ||
log --warning "You will need to make sure this computer's ip is in the allow list, then run 'sudo mount -a'"
fi
line="nas.housh.dev:/var/nfs/shared/Customer_Share /mnt/customers nfs defaults 0 0"
if sudo cat /etc/fstab | grep -vq "$line"; then
log " Setting up nas mount."
sudo mkdir -p /mnt/customers &>/dev/null
echo "$line" | sudo tee --append /etc/fstab
sudo systemctl daemon-reload
sudo mount -a ||
log --warning "You will need to make sure this computer's ip is in the allow list, then run 'sudo mount -a'"
fi
}
_setup-kanata() {