-
Notifications
You must be signed in to change notification settings - Fork 0
/
fix_permissions.sh
executable file
·34 lines (27 loc) · 1 KB
/
fix_permissions.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
#SBATCH -p shared
#SBATCH -c 1
#SBATCH --mem=2G
#SBATCH --job-name=fix_permissions
#SBATCH -o fix_permissions.log
#SBATCH -e fix_permissions.log
# Ensure permissions are correct on all source and lua files:
# 'ordinary_permissions' controls permissions on all lua files and non-conda-
# environment source files. 'conda_permissions' controls permissions on conda
# environments.
ordinary_permissions=775
conda_permissions=555
src_dir=/jhpce/shared/libd/core
lua_dir=/jhpce/shared/libd/modulefiles
echo "Setting default permissions on all source files..."
chmod -R $ordinary_permissions $src_dir
echo "Setting more-restrictive permissions on conda/ virtual environments..."
for env_dir in $(ls -1d ${src_dir}/*/*/*_env); do
echo "[Conda/venv dir] $env_dir"
chmod -R $conda_permissions $env_dir
done
echo "Setting open permissions on 'r_nac'..."
chmod -R 777 ${src_dir}/r_nac/1.0/nac_env
echo "Setting default permisions on all lua files..."
chmod -R $ordinary_permissions $lua_dir
echo "Done."