Ignore:
Timestamp:
Jan 13, 2025, 3:21:51 PM (2 days ago)
Author:
alloc
Message:

118: Fixed error when trying to edit instances without EDITOR set

Location:
scripts/usr/local/lib/7dtd/commands
Files:
2 edited

Legend:

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

    r353 r502  
    5858        done
    5959
    60         $RSYNC -a --delete --numeric-ids --delete-excluded $SDTD_BASE/instances/./ $NewBackup
     60        $RSYNC -a --delete --numeric-ids --delete-excluded -F $SDTD_BASE/instances/./ $NewBackup
    6161        touch $NewBackup
    6262       
  • scripts/usr/local/lib/7dtd/commands/instances.sh

    r483 r502  
    7878                cp $SDTD_BASE/engine/serverconfig.xml $IPATH/config.xml
    7979        fi
    80        
    81         $EDITOR $IPATH/config.xml
    82        
     80
     81        if [ -z "$EDITOR" ]; then
     82                echo "No EDITOR specified in the global configuration file (7dtd.conf)!"
     83                echo "Please add/edit the variable 'EDITOR' and set it to the text editor you would"
     84                echo "like to use to edit the XML configs, preferably an editor that supports XML"
     85                echo "syntax highlighting for easier editing."
     86                echo "Run '7dtd.sh instances edit $INSTANCE' afterwards to edit the configuration."
     87                echo
     88        else
     89                $EDITOR $IPATH/config.xml
     90        fi
     91
    8392        if [ -f "$SDTD_BASE/templates/admins.xml" ]; then
    8493                cp "$SDTD_BASE/templates/admins.xml" "$IPATH/"
     
    8998
    9099sdtdSubcommandInstancesEdit() {
     100        if [ -z "$EDITOR" ]; then
     101                echo "No EDITOR specified in the global configuration file (7dtd.conf)!"
     102                echo "Please add/edit the variable 'EDITOR' and set it to the text editor you would"
     103                echo "like to use to edit the XML configs, preferably an editor that supports XML"
     104                echo "syntax highlighting for easier editing."
     105                return
     106        fi
     107       
    91108        if [ $(isValidInstance "$1") -eq 0 ]; then
    92109                echo "No instance given or not a valid instance!"
Note: See TracChangeset for help on using the changeset viewer.