mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'tweak/linux-perms' into 'dev'
Add linux perms script See merge request crafty-controller/crafty-4!721
This commit is contained in:
commit
2e342f211b
15
.gitlab/scripts/linux_perms_fix.sh
Normal file
15
.gitlab/scripts/linux_perms_fix.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Prompt the user for the directory path
|
||||
read -p "Enter the directory path to set permissions (/var/opt/minecraft/crafty): " directory_path
|
||||
|
||||
# Check if the script is running within a Docker container
|
||||
if [ -f "/.dockerenv" ]; then
|
||||
echo "Script is running within a Docker container. Exiting with error."
|
||||
exit 1 # Exit with an error code if running in Docker
|
||||
else
|
||||
echo "Script is not running within a Docker container. Executing permissions changes..."
|
||||
# Run the commands to set permissions
|
||||
sudo chmod 700 $(find "$directory_path" -type d)
|
||||
sudo chmod 644 $(find "$directory_path" -type f)
|
||||
fi
|
Loading…
Reference in New Issue
Block a user