-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpco.sh
executable file
·27 lines (21 loc) · 880 Bytes
/
pco.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# copy last comment to clipboard
# broadcast comment in irc sbr-kernel-emeaedit comme
CASE=$(pwd|cut -f 6 -d "/")
OLD=$(ls -tr ~/redhat/comments/${CASE}*|tail -1)
LOG=~/redhat/scripts/cases.log
DATE=$(date +%Y%m%d%H%M)
irc() {
context=`dbus-send --dest=org.xchat.service --print-reply --type=method_call /org/xchat/Remote org.xchat.plugin.FindContext string:"Red Hat IRC" string:"" | tail -n1 | awk '{print $2}'`
dbus-send --dest=org.xchat.service --type=method_call /org/xchat/Remote org.xchat.plugin.SetContext uint32:$context
dbus-send --dest=org.xchat.service --type=method_call /org/xchat/Remote org.xchat.plugin.Command string:"msg #emea-sbr-kernel New update for case $CASE"
}
main() {
echo $OLD
aspell -c $OLD
cat $OLD|xsel
#irc
echo "Paste comment on ticketing system"
echo "$DATE: $CASE - new comment published" >> $LOG
}
main