Changeset 481


Ignore:
Timestamp:
Nov 14, 2023, 2:48:08 PM (13 months ago)
Author:
alloc
Message:

Scripts

Location:
scripts/usr/local/lib/7dtd
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • scripts/usr/local/lib/7dtd/commands/instances.sh

    r480 r481  
    7575       
    7676        $EDITOR $IPATH/config.xml
    77         configSetAutoParameters "$INSTANCE"
    7877       
    7978        if [ -f "$SDTD_BASE/templates/admins.xml" ]; then
  • scripts/usr/local/lib/7dtd/commands/start.sh

    r480 r481  
    5656                SSD_DAEMON="--background --no-close"
    5757                SSD_USER="--chuid $SDTD_USER:$SDTD_GROUP --user $SDTD_USER"
    58                 OPTS="-logfile $LOG -nographics -configfile=$(getInstancePath $1)/config.xml"
     58                OPTS="-logfile $LOG -nographics -configfile=$(getInstancePath $1)/config.xml -TelnetEnabled=true -AdminFileName=admins.xml -UserDataFolder=$(getInstancePath $1) "
    5959               
    6060                if [ "$(uname -m)" = "x86_64" ]; then
  • scripts/usr/local/lib/7dtd/commands/updateengine.sh

    r480 r481  
    174174                        PASSWORDARG=-betapassword $BRANCHPASSWORD
    175175                fi
    176                 #echo ./steamcmd.sh +login anonymous +force_install_dir $SDTD_BASE/engine +app_update 294420 -validate -beta $BRANCHNAME $PASSWORDARG +quit
    177                 ./steamcmd.sh +login anonymous +force_install_dir $SDTD_BASE/engine +app_update 294420 -validate -beta $BRANCHNAME $PASSWORDARG +quit
     176                #echo ./steamcmd.sh +force_install_dir $SDTD_BASE/engine +login anonymous +app_update 294420 -validate -beta $BRANCHNAME $PASSWORDARG +quit
     177                ./steamcmd.sh +force_install_dir $SDTD_BASE/engine +login anonymous +app_update 294420 -validate -beta $BRANCHNAME $PASSWORDARG +quit
    178178
    179179                if [ -d /usr/local/lib/7dtd/server-fixes ]; then
  • scripts/usr/local/lib/7dtd/common.sh

    r479 r481  
    120120                local APPMANIFEST=$(find $SDTD_BASE/engine -type f -name "appmanifest_294420.acf")
    121121                if [ -f "$APPMANIFEST" ]; then
    122                         LOCAL=$(grep betakey "$APPMANIFEST" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\  -f3)
     122                        LOCAL=$(grep -i '"betakey"' "$APPMANIFEST" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\  -f3)
    123123                        if [[ -z $LOCAL ]]; then
    124124                                LOCAL="public"
     
    141141                local APPMANIFEST=$(find $SDTD_BASE/engine -type f -name "appmanifest_294420.acf")
    142142                if [ -f "$APPMANIFEST" ]; then
    143                         LOCAL=$(grep buildid "$APPMANIFEST" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\  -f3)
     143                        LOCAL=$(grep -i '"buildid"' "$APPMANIFEST" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\  -f3)
    144144                        if [ $(isANumber "$LOCAL") -eq 0 ]; then
    145145                                LOCAL=0
     
    159159                local APPMANIFEST=$(find $SDTD_BASE/engine -type f -name "appmanifest_294420.acf")
    160160                if [ -f "$APPMANIFEST" ]; then
    161                         LOCAL=$(grep LastUpdated "$APPMANIFEST" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\  -f3)
     161                        LOCAL=$(grep -i '"LastUpdated"' "$APPMANIFEST" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\  -f3)
    162162                        if [ $(isANumber "$LOCAL") -eq 0 ]; then
    163163                                LOCAL=0
  • scripts/usr/local/lib/7dtd/serverconfig.sh

    r478 r481  
    2020## Generic worker functions
    2121
    22 
    23 # Set parameters for current instance that have forced values:
    24 #  - TelnetEnabled must be set so that management scripts can work
    25 #  - AdminFileName is made to point to the local instance admins.xml
    26 #  - SaveGameFolder is made to point to the instance folder
    27 #  - UserDataFolder (for GeneratedWorlds) is made to point to the <user home directory>/serverdata/
    28 # Params:
    29 #   1: Instance name
    30 configSetAutoParameters() {
    31         setConfigValue "$1" "TelnetEnabled" "true"
    32         setConfigValue "$1" "AdminFileName" "admins.xml"
    33         setConfigValue "$1" "SaveGameFolder" "$(getInstancePath "$1")"
    34         setConfigValue "$1" "UserDataFolder" "$SDTD_BASE/serverdata"
    35 }
    3622
    3723# Query for an instance name (will be saved in $INSTANCE)
     
    7864#   3: New value
    7965setConfigValue() {
     66        local XMLSTARLET_OPTS="-L -P"
    8067        local CONF=$(getInstancePath $1)/config.xml
    81         $XMLSTARLET ed -L -u "/ServerSettings/property[@name='$2']/@value" -v "$3" $CONF
     68        local XPATHBASE="//property[@name='$2']"
     69       
     70        if [ -z $($XMLSTARLET sel -t -v "$XPATHBASE/@name" $CONF) ]; then
     71                $XMLSTARLET ed $XMLSTARLET_OPTS \
     72                        -s "/*[1]" -t elem -n "property" \
     73                        -i "//property[not(@name)]" -t attr -n "name" -v "$2" \
     74                        -i "$XPATHBASE" -t attr -n "value" -v "$3" \
     75                        $CONF
     76        else
     77                $XMLSTARLET ed $XMLSTARLET_OPTS -u "$XPATHBASE/@value" -v "$3" $CONF
     78        fi
    8279}
Note: See TracChangeset for help on using the changeset viewer.