Skip to content

Instantly share code, notes, and snippets.

@ElijahLynn
Forked from funzoneq/simplehttp.service
Last active May 7, 2019 05:25
Show Gist options
  • Select an option

  • Save ElijahLynn/ce1a103a6caa7dbd11f7facb3c943f8f to your computer and use it in GitHub Desktop.

Select an option

Save ElijahLynn/ce1a103a6caa7dbd11f7facb3c943f8f to your computer and use it in GitHub Desktop.

Revisions

  1. ElijahLynn revised this gist May 7, 2019. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions simplehttp.service
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,12 @@
    # Upstream https://gist.github.com/ElijahLynn/ce1a103a6caa7dbd11f7facb3c943f8f
    [Unit]
    Description=Job that runs the python SimpleHTTPServer daemon
    Description=Job that runs the Python SimpleHTTPServer daemon
    Documentation=man:SimpleHTTPServer(1)

    [Service]
    Type=simple
    WorkingDirectory=/tmp/letsencrypt
    WorkingDirectory=/tmp/backups
    ExecStartPre=-/usr/bin/mkdir /tmp/backups
    ExecStart=/usr/bin/python -m SimpleHTTPServer 80 &
    ExecStop=/bin/kill `/bin/ps aux | /bin/grep SimpleHTTPServer | /bin/grep -v grep | /usr/bin/awk '{ print $2 }'`

  2. @funzoneq funzoneq created this gist May 25, 2016.
    12 changes: 12 additions & 0 deletions simplehttp.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    [Unit]
    Description=Job that runs the python SimpleHTTPServer daemon
    Documentation=man:SimpleHTTPServer(1)

    [Service]
    Type=simple
    WorkingDirectory=/tmp/letsencrypt
    ExecStart=/usr/bin/python -m SimpleHTTPServer 80 &
    ExecStop=/bin/kill `/bin/ps aux | /bin/grep SimpleHTTPServer | /bin/grep -v grep | /usr/bin/awk '{ print $2 }'`

    [Install]
    WantedBy=multi-user.target