Commit 39c2c4c1 authored by anthraxx's avatar anthraxx
Browse files

including files from actual basedir

this supports arbitrary symlinking of the scripts and
retrives the actual dirname where the files are laying.
parent 12be452e
#!/bin/sh #!/bin/sh
source shared . $(dirname $(readlink "$0"))/shared
echo "Initializing Space Systems..." echo "Initializing Space Systems..."
echo "22" > /sys/class/gpio/unexport echo "22" > /sys/class/gpio/unexport
......
#!/bin/sh #!/bin/sh
basedir=$(dirname $(readlink "$0"))
config="dooris.conf" config="dooris.conf"
# warn if local config file is missing # warn if local config file is missing
if [ ! -f "${config}" ]; then if [ ! -f "${basedir}/${config}" ]; then
echo "WARNING: ${config} is missing!" >&2 echo "WARNING: ${config} is missing!" >&2
fi fi
# get password config value in a safe way # get password config value in a safe way
password="$(grep password ${config} 2>/dev/null|cut -d= -f2|tr -d ' \t')" password="$(grep password ${basedir}/${config} 2>/dev/null|cut -d= -f2|tr -d ' \t')"
if [ -z "${password}" ]; then if [ -z "${password}" ]; then
echo "WARNING: password in ${config} is missing!" >&2 echo "WARNING: password in ${config} is missing!" >&2
fi fi
#!/bin/sh #!/bin/sh
source shared . $(dirname $(readlink "$0"))/shared
echo "Initializing Space Systems..." echo "Initializing Space Systems..."
echo "27" > /sys/class/gpio/unexport echo "27" > /sys/class/gpio/unexport
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment