Ignore:
Timestamp:
Jun 9, 2014, 2:00:26 PM (10 years ago)
Author:
alloc
Message:

Version 15: Fixes #16, adds --force to updatescripts

File:
1 edited

Legend:

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

    r51 r53  
    44
    55sdtdCommandUpdatescripts() {
    6         LOCAL=$(cat /usr/local/lib/7dtd/VERSION | grep "Version" | cut -d\  -f2)
    7         REMOTE=$(wget -qO- http://illy.bz/fi/7dtd/VERSION | grep "Version" | cut -d\  -f2)
     6        local LOCAL=$(cat /usr/local/lib/7dtd/VERSION | grep "Version" | cut -d\  -f2)
     7        local REMOTE=$(wget -qO- http://illy.bz/fi/7dtd/VERSION | grep "Version" | cut -d\  -f2)
    88       
    9         if [ $REMOTE -gt $LOCAL ]; then
     9        local FORCED
     10        if [ "$1" = "--force" ]; then
     11                FORCED=yes
     12        else
     13                FORCED=no
     14        fi
     15        if [ "$FORCED" = "yes" -o $REMOTE -gt $LOCAL ]; then
    1016                echo "A newer version of the scripts is available."
    1117                echo "Local:     v.$LOCAL"
     
    5864
    5965sdtdCommandUpdatescriptsHelp() {
    60         echo "Usage: $(basename $0) updatescripts"
     66        echo "Usage: $(basename $0) updatescripts [--force]"
    6167        echo
    6268        echo "Check for a newer version of the management scripts. If there is a newer"
    6369        echo "version they can be updated by this command."
     70        echo
     71        echo "If --force is specified you are asked if you want to redownload the scripts"
     72        echo "even if there is no new version available."
    6473}
    6574
     
    6877}
    6978
     79sdtdCommandUpdatescriptsExpects() {
     80        case $1 in
     81                2)
     82                        echo "--force"
     83                        ;;
     84        esac
     85}
     86
Note: See TracChangeset for help on using the changeset viewer.