Add support for displaying which mods are active in the server container when listing the installed mods.

This commit is contained in:
Daniel Ceregatti 2025-07-30 13:54:42 -06:00
parent a64a61962e
commit 386cd4878c

View file

@ -73,10 +73,9 @@ prompt_yn(){
fi
}
# List mods
# List mods. Highlight the ones that are active when run from the server script.
list(){
X=1
C="${green}"
spaces=" "
FIRST=1
for link in $(ls -d ${SERVER_FILES}/@* 2> /dev/null | sort)
@ -91,6 +90,11 @@ list(){
ID=$(readlink ${link} | awk -F/ '{print $NF}')
MODNAME=$(get_mod_name ${ID})
SIZE=$(du -sh "${WORKSHOP_DIR}/${ID}" | awk '{print $1}')
C="${yellow}"
if [[ -L ${SERVER_PROFILE}/@${MODNAME} ]]
then
C="${green}"
fi
printf "${C}%.3d %s %.30s %s https://steamcommunity.com/sharedfiles/filedetails/?id=%s %s${default}\n" ${X} ${ID} "${MODNAME}" "${spaces:${#MODNAME}}" ${ID} ${SIZE}
X=$((X+1))
done