project-abigail / abigail-device

This is the code that runs on abigail's device
0 stars 1 forks source link

Adapt scripts to find the current directory and use it in systemd startup file #23

Closed julienw closed 7 years ago

julienw commented 7 years ago

After a few tries, here is a way to find the directory where the script is in bash:

source_dir=$( cd "$(dirname "$0")" ; pwd )

This is more complex than dirname $0 but gives you the full normalized directory.

Then we can use it to replace the name in the startup file.