This repository has been archived by the owner on Dec 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #21
- Loading branch information
Showing
2 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#! /bin/bash -w | ||
# This presumes login data is stored in .mylogin.cnf, | ||
# $MYSQL_HOST is set to the default mysql host | ||
# & $PUSHBOX_DATABASE is the name of the containing database. | ||
# If the PUSHBOX_DATABASE is not defined, this script will attempt | ||
# to extract it from the `Rocket.toml` file. | ||
if [ "$PUSHBOX_DATABASE" = "" ]; then | ||
echo "Fetching database..." | ||
PUSHBOX_DATABASE=`grep "^database_url" Rocket.toml | sed 's/"//g'| tr '/' "\n" | tail -1` | ||
fi | ||
mysql $PUSHBOX_DATABASE -e "DELETE FROM pushboxv1 WHERE ttl < unix_timestamp();" |