Permalink
Browse files

keeping the keep-alive scripts in git for easier deployment.

  • Loading branch information...
1 parent 41a24ea commit d4929959e9557e2cd7d0c9c81af83904fa974d91 @dyoo dyoo committed Mar 21, 2013
Showing with 16 additions and 0 deletions.
  1. +7 −0 keep-alive-scripts/is_dead.rkt
  2. +9 −0 keep-alive-scripts/keep_alive.sh
@@ -0,0 +1,7 @@
+#lang racket/base
+
+;; exits with 1 if the system thinks the local web server is down.
+(require net/url)
+(with-handlers ([exn:fail:network? (lambda (exn) (exit 1))])
+ (get-pure-port (string->url "http://localhost:8000/"))
+ (exit 0))
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+/home/ubuntu/racket/bin/racket /home/ubuntu/is_dead.rkt
+if [ $? -eq "1" ];
+then
+ /home/ubuntu/startup.sh
+else
+ :
+fi

0 comments on commit d492995

Please sign in to comment.