-
-
Save benhylau/fc90382ac73ee497a8f8ae52c5f88ab2 to your computer and use it in GitHub Desktop.
execute arbitrary bash code/variable substitution in systemd units
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment