mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-13 22:02:34 +00:00
feat: Adds customer share mount to runs/after/system
This commit is contained in:
21
env/.local/scripts/hpa
vendored
21
env/.local/scripts/hpa
vendored
@@ -22,15 +22,20 @@ SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
|||||||
|
|
||||||
############################## MAIN ##############################
|
############################## MAIN ##############################
|
||||||
|
|
||||||
last_pull="0"
|
# Don't pull images if they're prefixed with 'localhost'.
|
||||||
if [[ -f "$HPA_CONFIG_DIR/.lastpull" ]]; then
|
if echo "$HPA_DOCKER_IMAGE" | grep -vq "localhost"; 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
|
# Check if we should pull the image prior to running.
|
||||||
. "$SCRIPTS/hpa-pull" "$HPA_AUTO_PULL_OPTS"
|
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
|
fi
|
||||||
|
|
||||||
podman run --rm --interactive --tty \
|
podman run --rm --interactive --tty \
|
||||||
|
|||||||
2
env/.local/scripts/utils/hpa/hpa.env
vendored
2
env/.local/scripts/utils/hpa/hpa.env
vendored
@@ -12,7 +12,7 @@ XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
|
|||||||
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
|
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
|
||||||
|
|
||||||
# Docker vars.
|
# 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"}
|
HPA_DOCKER_TAG=${HPA_DOCKER_TAG:-"latest"}
|
||||||
|
|
||||||
# Auto pull options to be ran before running the hpa docker
|
# Auto pull options to be ran before running the hpa docker
|
||||||
|
|||||||
@@ -18,6 +18,15 @@ _setup-mounts() {
|
|||||||
sudo mount -a ||
|
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'"
|
log --warning "You will need to make sure this computer's ip is in the allow list, then run 'sudo mount -a'"
|
||||||
fi
|
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() {
|
_setup-kanata() {
|
||||||
|
|||||||
Reference in New Issue
Block a user