[16685e]: / codesys-ide / codesys  Maximize  Restore  History

Download this file

20 lines (15 with data), 663 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

if [ -d /usr/local/share/codesys ]; then
    BASEPATH=/usr/local/share/codesys
else    
    BASEPATH=$(pwd)/scripts
fi

# check if file exists, before we call CODESYS with it
if [ ! -f ${BASEPATH}/${1}.py ]; then
    echo "error: script '${BASEPATH}/${1}.py' not found."
    exit -1
fi

# get first CODESYS profile and start the script with it
profile=$(basename "$(ls -1 ~/.wine.cds/drive_c/CODESYS/CODESYS/Profiles/*.profile | head -n 1 | sed 's,.profile,,')")
export WINEPREFIX=~/.wine.cds
wine-development ~/.wine.cds/drive_c/CODESYS/CODESYS/Common/CODESYS.exe --culture=en --profile="'"${profile}"'" --runscript="z:${BASEPATH}/${1}.py" --noUI