mirror of
https://github.com/wickedyoda/public-setupfiles.git
synced 2026-11-16 13:31:56 -06:00
Reorganize repository structure and refresh READMEs
This commit is contained in:
1 parent
2270530d9e
commit
a8b7ccbf2a
170 files changed
+616
-1391
No files matched your search
@@ -0,0 +1,14 @@
|
||||
# reset_perms
|
||||
|
||||
## Overview
|
||||
Scripts for resetting file or directory permissions.
|
||||
|
||||
## Contents
|
||||
- `reset_perms 1.sh`
|
||||
- `reset_perms.sh`
|
||||
|
||||
## Usage
|
||||
Use these scripts carefully when permissions have drifted and need to be normalized.
|
||||
|
||||
## Notes
|
||||
Permission changes can have broad effects, so confirm ownership and target paths first.
|
||||
Whitespace-only changes.
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Define mount points and devices
|
||||
declare -A mounts=(
|
||||
["/mnt/public"]="/dev/sdc1"
|
||||
["/mnt/public-bk"]="/dev/sde1"
|
||||
["/mnt/public2"]="/dev/sdd1"
|
||||
["/mnt/public2-bk"]="/dev/sdb1"
|
||||
)
|
||||
|
||||
# Ensure mount folders exist
|
||||
for dir in "${!mounts[@]}"; do
|
||||
echo "Creating $dir if needed..."
|
||||
mkdir -p "$dir"
|
||||
done
|
||||
|
||||
# Mount each device to its folder
|
||||
for dir in "${!mounts[@]}"; do
|
||||
device="${mounts[$dir]}"
|
||||
echo "Mounting $device to $dir..."
|
||||
mount "$device" "$dir"
|
||||
done
|
||||
|
||||
# Bind mount for timeshift folders
|
||||
echo "Creating timeshift bind mounts..."
|
||||
mkdir -p /mnt/timeshift /mnt/timeshift1
|
||||
mount --bind /mnt/public2 /mnt/timeshift
|
||||
mount --bind /mnt/public2-bk /mnt/timeshift1
|
||||
|
||||
# Apply root ownership and full permissions
|
||||
echo "Setting root:root ownership and chmod 777..."
|
||||
for path in /mnt/public /mnt/public-bk /mnt/public2 /mnt/public2-bk /mnt/timeshift /mnt/timeshift1; do
|
||||
echo "Processing $path..."
|
||||
chown -R root:root "$path"
|
||||
chmod -R 777 "$path"
|
||||
done
|
||||
|
||||
echo "All mounts and permissions applied successfully."
|
||||
Reference in new issue
Block a user