mirror of
https://ceregatti.org/git/daniel/dayzdockerserver.git
synced 2025-08-09 08:33:35 +00:00
Add support for running post mod install scripts.
Fix the use of an environment variable that conflicts with a shell variable.
This commit is contained in:
parent
fcda4d1d60
commit
0f2ecce170
1 changed files with 18 additions and 6 deletions
24
web/bin/dz
24
web/bin/dz
|
@ -123,6 +123,7 @@ add(){
|
|||
echo -e "Mod id ${1} - ${green}${MODNAME}${default} - added"
|
||||
xml ${ID}
|
||||
map ${ID}
|
||||
installMod ${ID}
|
||||
}
|
||||
|
||||
# Remove a mod
|
||||
|
@ -146,6 +147,17 @@ remove(){
|
|||
echo -e "Mod id ${1} - ${red}${MODNAME}${default} - removed"
|
||||
}
|
||||
|
||||
# Handle custom scripts after installing a mod
|
||||
installMod(){
|
||||
FILE="${WORKSHOP_DIR}/${1:?}/install.sh"
|
||||
if [ -f "${FILE}" ]
|
||||
then
|
||||
MODNAME=$(get_mod_name ${1})
|
||||
echo "Running custom install script ${FILE} for mod id ${1}"
|
||||
${FILE}
|
||||
fi
|
||||
}
|
||||
|
||||
# Handle the Steam login information.
|
||||
login(){
|
||||
if [ -f "${STEAM_LOGIN}" ]
|
||||
|
@ -324,14 +336,14 @@ Mods: "
|
|||
|
||||
map(){
|
||||
# Install map mpmissions for mods that have them. Presumes a map.env was created for the mod, with the required metadata (git URL, etc.)
|
||||
TERM="map"
|
||||
if [[ "${1}" =~ ^[0-9]+$ ]]
|
||||
then
|
||||
TERM="mod id"
|
||||
fi
|
||||
WHICH="map"
|
||||
if [[ "${1}" =~ ^[0-9]+$ ]]
|
||||
then
|
||||
WHICH="mod id"
|
||||
fi
|
||||
if [ -f "${FILES}/mods/${1}/map.env" ]
|
||||
then
|
||||
echo "Installing mpmissions files for ${TERM} ${1}..."
|
||||
echo "Installing mpmissions files for ${WHICH} ${1}..."
|
||||
source ${FILES}/mods/${1}/map.env
|
||||
${FILES}/bin/map.sh ${1} install
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue