forked from jsk-ros-pkg/jsk_robot
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[jsk_fetch_startup] Attach log file when update_workspace failed.
- Loading branch information
1 parent
a8e2611
commit d44a4b7
Showing
2 changed files
with
20 additions
and
4 deletions.
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
. $HOME/ros/melodic/devel/setup.bash | ||
# Filename should end with .txt to preview the contents in a web browser | ||
LOGFILE=$HOME/ros/melodic/update_workspace.txt | ||
|
||
{ | ||
set -x | ||
# Update workspace | ||
cd $HOME/ros/melodic/src | ||
|
@@ -18,11 +21,21 @@ CATKIN_BUILD_RESULT=$? | |
# Send mail | ||
MAIL_BODY="" | ||
if [ $WSTOOL_UPDATE_RESULT -ne 0 ]; then | ||
MAIL_BODY=$MAIL_BODY"Please wstool update workspace manually\n" | ||
MAIL_BODY=$MAIL_BODY"Please wstool update workspace manually. " | ||
fi | ||
if [ $CATKIN_BUILD_RESULT -ne 0 ]; then | ||
MAIL_BODY=$MAIL_BODY"Please catkin build workspace manually\n" | ||
MAIL_BODY=$MAIL_BODY"Please catkin build workspace manually." | ||
fi | ||
LC_CTYPE=en_US.UTF-8 /bin/echo -e $MAIL_BODY | /usr/bin/mail -s "Daily workspace update fails" -r $(hostname)@jsk.imi.i.u-tokyo.ac.jp [email protected] | ||
|
||
set +x | ||
} > $LOGFILE 2>&1 | ||
rostopic pub -1 /email jsk_robot_startup/Email "header: | ||
seq: 0 | ||
stamp: {secs: 0, nsecs: 0} | ||
frame_id: '' | ||
subject: 'Daily workspace update fails' | ||
body: '$MAIL_BODY' | ||
sender_address: '$(hostname)@jsk.imi.i.u-tokyo.ac.jp' | ||
receiver_address: '[email protected]' | ||
smtp_server: '' | ||
smtp_port: '' | ||
attached_files: ['$LOGFILE']" |