mirror of
https://src.koozali.org/infra/smeserver-koji.git
synced 2024-11-22 01:27:29 +01:00
32 lines
682 B
Bash
Executable File
32 lines
682 B
Bash
Executable File
#!/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
|
|
|
|
# Install nfs-utils
|
|
dnf install -y nfs-utils
|
|
|
|
KOJI_MOUNT_SERVICE="${KOJI_DIR:1}"
|
|
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
|
|
Where=$KOJI_DIR
|
|
Type=nfs
|
|
Options=defaults,ro
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
systemctl daemon-reload
|
|
systemctl enable --now "$KOJI_MOUNT_SERVICE"
|