looking for coder to do small task (shell)

Status
This thread has been locked.

Se Te Paro

Banned
Feedback score
0
Posts
2
Reactions
0
Resources
0
Hey
My name is Se Te Paro El Taxi and Im Looking for coder to do small changes to shell script i will pay yes

HTML:
#!/bin/bash
DIR="$(cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
cd "$DIR"

DO_LOOP="no"

while getopts "p:f:l" OPTION 2> /dev/null; do
    case ${OPTION} in
        p)
            PHP_BINARY="$OPTARG"
            ;;
        f)
            POCKETMINE_FILE="$OPTARG"
            ;;
        l)
            DO_LOOP="yes"
            ;;
        \?)
            break
            ;;
    esac
done

if [ "$PHP_BINARY" == "" ]; then
    if [ -f ./bin/php7/bin/php ]; then
        export PHPRC=""
        PHP_BINARY="./bin/php7/bin/php"
    elif [[ ! -z $(type php) ]]; then
        PHP_BINARY=$(type -p php)
    else
        echo "Couldn't find a working PHP 7 binary, please use the installer."
        exit 1
    fi
fi

if [ "$POCKETMINE_FILE" == "" ]; then
    if [ -f ./PocketMine-MP.phar ]; then
        POCKETMINE_FILE="./PocketMine-MP.phar"
    elif [ -f ./src/pocketmine/PocketMine.php ]; then
        POCKETMINE_FILE="./src/pocketmine/PocketMine.php"
    else
        echo "Couldn't find a valid PocketMine-MP installation"
        exit 1
    fi
fi

LOOPS=0

set +e
while [ "$LOOPS" -eq 0 ] || [ "$DO_LOOP" == "yes" ]; do
    if [ "$DO_LOOP" == "yes" ]; then
        "$PHP_BINARY" "$POCKETMINE_FILE" $@
    else
        exec "$PHP_BINARY" "$POCKETMINE_FILE" $@
    fi
    if [ "$DO_LOOP" == "yes" ]; then
        if [ ${LOOPS} -gt 0 ]; then
            echo "Restarted $LOOPS times"
        fi
        echo "To escape the loop, press CTRL+C now. Otherwise, wait 5 seconds for the server to restart."
        echo ""
        sleep 5
        ((LOOPS++))
    fi
done

I need to make it so every time is ran or restarted (see "Restarted $loops times") in first place it
- deletes folder recursively that might be alredy created by repo cloner below at /root/plugins/MyPrivateClonedRepoName except these files (IF THEY EXIST): config.yml, lang.properties, lang.properties.old, help-command.json
- clones private github repository to /root/plugins/
- debug/print when it is being downloaded and when its downloaded

thats all
 
Last edited:
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.
Status
This thread has been locked.
Top