Last active
March 18, 2025 18:55
-
-
Save ljm42/d612bcfbc071d854baba53c482fd64e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# version 1.6 | |
# latest version of this script: https://gist.github.com/ljm42/d612bcfbc071d854baba53c482fd64e4 | |
# see also https://forums.unraid.net/topic/103886-permissions-on-files-installed-by-plugins/ | |
# | |
# run this script to check for file ownership and permission problems on Unraid plugin txz files | |
# | |
# to use: | |
# * cd /tmp | |
# * wget https://gist.github.com/ljm42/d612bcfbc071d854baba53c482fd64e4/raw -O plgcheck | |
# * bash plgcheck | |
i=1 | |
for f in $(find /boot/config/plugins -name '*.txz' -o -name '*.tar.gz' -o -name '*.tgz' | sort -f); do | |
# skip precompiled packages | |
# only precompiled packages should be in these directories, not the plugin's main txz file | |
[[ $f =~ /NerdPack\/packages/ ]] && continue | |
[[ $f =~ /DevPack\/packages/ ]] && continue | |
[[ $f =~ /nvidia-driver\/packages/ ]] && continue | |
[[ $f =~ /dvb-driver\/packages/ ]] && continue | |
[[ $f =~ /mft-tools\/packages/ ]] && continue | |
[[ $f =~ /iscsi\/packages/ ]] && continue | |
[[ $f =~ /Unraid-Kernel-Helper\/packages/ ]] && continue | |
[[ $f =~ /nct6687-driver\/packages/ ]] && continue | |
[[ $f =~ /coral-driver\/packages/ ]] && continue | |
[[ $f =~ /hpsahba\/packages/ ]] && continue | |
echo "$((i++)) $f" | |
# show ownership issues | |
OWN="$(less "$f" | grep -v "root/root" | grep -v "root root")" | |
[[ -n $OWN ]] && echo && echo "Ownership issues (should be root/root)" && echo "${OWN}" | |
# show permissions issues | |
PERM="$(less "$f" | grep -v "rwxr-xr-x" | grep -v "rw-r--r--")" | |
[[ -n $PERM ]] && echo && echo "Permission issues (should be rwxr-xr-x or rw-r--r--)" && echo "${PERM%x}" | |
echo | |
done |
good idea, thanks!
Please add .tgz files also. I use a zipped bundle and not a package.
Thanks @dlandon, we're now checking for *.tgz too
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks good. I was able to skip 100+ txz's by adding an exception for DevPack packages as well:
[[ $f =~ /DevPack\/packages/ ]] && continue