Skip to content

Commit fa5aa73

Browse files
authored
ReposadoNotification.sh - v 1.1
Added a check to make sure the Storage volume containing the Reposado files is mounted before proceeding.
1 parent 45155aa commit fa5aa73

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

ReposadoNotification.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Version 1.0
3+
# Version 1.1
44
# For information on this script visit:
55
# https://www.kevinmcox.com/2019/04/automating-reposado-with-slack-notifications
66

@@ -18,6 +18,15 @@ SLACK_NOTIFY=true
1818
SLACK_WEBHOOK_URL="https://hooks.slack.com/services/<COMPLETE URL HERE>"
1919
SLACK_ICON_URL="https://raw.githubusercontent.com/wdas/reposado/master/other/reposado.jpg"
2020

21+
# Make sure the Storage volume is mounted before continuing
22+
if
23+
[ ! -f /Volumes/Storage/reposado/html/index.html ]
24+
then
25+
echo "Storage volume does not appear to be mounted, exiting."
26+
curl -X POST -H 'Content-type: application/json' --data '{"username":"Reposado","icon_url":"'"$SLACK_ICON_URL"'","text":"*WARNING:* The Storage volume is not mounted."}' $SLACK_WEBHOOK_URL
27+
exit 1
28+
fi
29+
2130
# Run repo_sync to fetch latest updates from Apple
2231
$REPO_SYNC
2332

0 commit comments

Comments
 (0)