improve syntax for accessing service outputs

This commit is contained in:
Daniel Barlow 2022-10-02 16:35:55 +01:00
parent 2d7bb6b2fa
commit e9f04931fa
5 changed files with 22 additions and 20 deletions

View file

@ -10,10 +10,11 @@ test -n "$contents" && for d in $contents; do
mkdir -p $out/${name}/contents.d
touch $out/${name}/contents.d/$d
done
test -n "$run" && (echo -e "#!$shell\n$run" > $out/${name}/run)
test -n "$run" && (echo -e "$run" > $out/${name}/run)
test -n "${notificationFd}" && (echo ${notificationFd} > $out/${name}/notification-fd)
test -n "$up" && (echo -e "#!$shell\n$up" > $out/${name}/up)
test -n "$down" && (echo -e "#!$shell\n$down" > $out/${name}/down)
test -n "$up" && (echo -e "$up" > $out/${name}/up)
test -n "$down" && (echo -e "$down" > $out/${name}/down)
( cd $out && ln -s /run/service-state/${name} ./.outputs )
for i in $out/${name}/{down,up,run} ; do test -f $i && chmod +x $i; done
true
# (echo $out/${name} && cd $out/${name} && find . -ls)