feat: dnf module (#377)

Co-authored-by: xyny <60004820+xynydev@users.noreply.github.com>
Co-authored-by: Gerald Pinder <gmpinder@gmail.com>
Co-authored-by: certifiedfoolio <156134535+cherry-os@users.noreply.github.com>
Co-authored-by: xyny <git@xyny.anonaddy.me>
Co-authored-by: somebody once told me <156134535+certifiedfoolio@users.noreply.github.com>
Co-authored-by: franute <franute@gmail.com>
This commit is contained in:
fiftydinar 2025-04-27 16:49:39 +02:00 committed by GitHub
parent d12d657371
commit fef0f17870
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 1712 additions and 4 deletions

27
modules/dnf/optfix.sh Normal file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -euo pipefail
SOURCE_DIR="/usr/lib/opt"
TARGET_DIR="/var/opt"
# Ensure the target directory exists
mkdir -p "$TARGET_DIR"
# Loop through directories in the source directory
for dir in "$SOURCE_DIR/"*/; do
if [ -d "$dir" ]; then
# Get the base name of the directory
dir_name=$(basename "$dir")
# Check if the symlink already exists in the target directory
if [ -L "$TARGET_DIR/$dir_name" ]; then
echo "Symlink already exists for $dir_name, skipping."
continue
fi
# Create the symlink
ln -s "$dir" "$TARGET_DIR/$dir_name"
echo "Created symlink for $dir_name"
fi
done