2023-03-03 23:20:59 +01:00
|
|
|
{writeText}:
|
|
|
|
writeText "service-fns.sh" ''
|
|
|
|
output() { cat $1/.outputs/$2; }
|
|
|
|
output_path() { echo $(realpath $1/.outputs)/$2; }
|
2024-02-13 22:41:43 +01:00
|
|
|
SERVICE_OUTPUTS=/run/services/outputs
|
|
|
|
SERVICE_STATE=/run/services/state
|
2023-03-03 23:20:59 +01:00
|
|
|
mkoutputs() {
|
2024-02-13 22:41:43 +01:00
|
|
|
d=$SERVICE_OUTPUTS/$1
|
|
|
|
mkdir -m 2751 -p $d && chown root:system $d
|
|
|
|
echo $d
|
|
|
|
}
|
|
|
|
mkstate() {
|
|
|
|
d=$SERVICE_STATE/$1
|
2023-08-28 21:53:45 +02:00
|
|
|
mkdir -m 2751 -p $d && chown root:system $d
|
2023-03-03 23:20:59 +01:00
|
|
|
echo $d
|
|
|
|
}
|
2023-03-04 00:06:18 +01:00
|
|
|
in_outputs() {
|
|
|
|
cd `mkoutputs $1` && umask 0027
|
|
|
|
}
|
2023-03-03 23:20:59 +01:00
|
|
|
''
|