smeserver-koji/koji-setup/deploy-koji-nfs-client.sh

29 lines
636 B
Bash
Raw Normal View History

2023-08-28 06:44:38 +02:00
#!/bin/bash
# Copyright (C) 2019 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
set -xe
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
source "$SCRIPT_DIR"/globals.sh
source "$SCRIPT_DIR"/parameters.sh
2023-08-31 04:28:25 +02:00
KOJI_MOUNT_SERVICE="${KOJI_DIR:1}"
2023-08-28 06:44:38 +02:00
KOJI_MOUNT_SERVICE="${KOJI_MOUNT_SERVICE/\//-}".mount
mkdir -p /etc/systemd/system
cat > /etc/systemd/system/"$KOJI_MOUNT_SERVICE" <<- EOF
[Unit]
Description=Koji NFS Mount
After=network.target
[Mount]
What=$KOJI_MASTER_FQDN:$KOJI_DIR
2023-08-31 04:28:25 +02:00
Where=$KOJI_DIR
2023-08-28 06:44:38 +02:00
Type=nfs
Options=defaults,ro
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now "$KOJI_MOUNT_SERVICE"