about summary refs log tree commit diff
diff options
context:
space:
mode:
authorthekettu <samantha.chalker@nccgroup.trust>2018-04-08 18:28:57 -0700
committerthekettu <samantha.chalker@nccgroup.trust>2018-04-08 18:28:57 -0700
commitf5e9ab45b12ba52316f739a79648ef6b1cfd121e (patch)
treefab4d300bb0041123a422daa9e69ce8d97de5a01
parent187a54cec81e1e60f209fab8f19aeb5195521440 (diff)
shellcheck
-rwxr-xr-xin-a-box/mastodon.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/in-a-box/mastodon.sh b/in-a-box/mastodon.sh
index 339913d..3975646 100755
--- a/in-a-box/mastodon.sh
+++ b/in-a-box/mastodon.sh
@@ -64,17 +64,17 @@ do_acme() {
 }
 
 do_backup() {
-  if ["$2" == "daily" ]; then
+  if [ "$2" == "daily" ]; then
     find "$(pwd)/.docker/mastodon/backups" -type f -name postgres-daily.* -mtime +7 -delete
     docker-compose exec -T -u postgres db sh -c "umask 0377 && /usr/local/bin/pg_dump -Fc -h db -d postgres -U postgres" > "$(pwd)/.docker/mastodon/backups/postgres-daily.$(date -Iseconds).pgsql"
   fi
 
-  if ["$2" == "hourly" ]; then
+  if [ "$2" == "hourly" ]; then
     find "$(pwd)/.docker/mastodon/backups" -type f -name postgres-hourly.* --min +360 -delete
     docker-compose exec -T -u postgres db sh -c "umask 0377 && /usr/local/bin/pg_dump -Fc -h db -d postgres -U postgres" > "$(pwd)/.docker/mastodon/backups/postgres-hourly.$(date -Iseconds).pgsql"
   fi
 
-  if ["$2" == "restore" ]; then
+  if [ "$2" == "restore" ]; then
     docker-compose run --rm db sh -c "/usr/local/bin/psql --set ON_ERROR_STOP=on -Fc -h db -d postgres -U postgres" < "$3"
   fi
 }
@@ -100,9 +100,9 @@ case "$1" in
     do_cron
     ;;
   backup)
-    do_backup
+    do_backup "$@"
     ;;
   *)
-    do_rake
+    do_rake "$@"
     ;;
 esac