Skip to content

Instantly share code, notes, and snippets.

@ryanj
Created July 7, 2020 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanj/260ac2751f182a8ff4c9eb120f1eab05 to your computer and use it in GitHub Desktop.
Save ryanj/260ac2751f182a8ff4c9eb120f1eab05 to your computer and use it in GitHub Desktop.
a Systemd unit for my Raspberry Pi (podman powered)
[Unit]
Description=Revealjs slides, powered by GitHub Gist
Documentation=https://github.com/ryanj/gist-reveal
Requires=network.target
Wants=network-online.target
After=network-online.target
Before=shutdown.target multi-user.target
Conflicts=shutdown.target
[Install]
WantedBy=multi-user.target
[Service]
Environment="DEFAULT_GIST=f30fc4c4555da88b5bc57d4d436ce026"
Environment="GH_CLIENT_SECRET=YOUR_GH_CLIENT_SECRET"
Environment="GH_CLIENT_ID=YOUR_GH_CLIENT_ID"
Environment="IMG=ryanj/gist-reveal:latest"
Environment="CONTAINER_NAME=reveal"
Restart=always
ExecStartPre=-/usr/bin/podman rm --force ${CONTAINER_NAME}
ExecStart=/usr/bin/podman run -it --rm --name ${CONTAINER_NAME} -e DEFAULT_GIST=${DEFAULT_GIST} -e GH_CLIENT_SECRET=${GH_CLIENT_SECRET} -e GH_CLIENT_ID=${GH_CLIENT_ID} --volume /tmp:/opt/app-root/src/css/theme/gists ${IMG}
ExecStop=-/usr/bin/podman rm --force ${CONTAINER_NAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment