Skip to content

Instantly share code, notes, and snippets.

@LordFPL
LordFPL / systemd-prblm.service
Created May 9, 2016 11:12 — forked from nickjacob/systemd-prblm.service
execute arbitrary bash code/variable substitution in systemd units
[Unit]
Description=Demonstrate Bash
[Service]
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment MYVAR=$(( 2 + 2 ))"
ExecStart=/usr/bin/ech "2 + 2 = ${MYVAR}"