Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- declare -A COWORKERS
- COWORKERS[charles]=1
- COWORKERS[thomas]=1
- COWORKERS[flavio]=1
- COWORKERS[michel]=1
- COWORKERS[david]=1
- COWORKERS[alexis]=1
- COWORKERS[igor]=1
- RESPONSE=$(echo -e "HTTP/1.1 200 OK\n\nUser notified")
- while [ 1 ]
- do
- REQ=$(nc -i1 -l 29090 <<< "$RESPONSE")
- RP=$(grep "^GET" <<< "$REQ")
- USER=$(perl -pe 's|.*user=(.*?)&.*|\1|' <<< $RP)
- if [[ ${COWORKERS[$USER]} -ne 1 ]]; then
- continue
- fi
- MSG=$(perl -pe 's|.*message=(.*?) HTTP.*$|\1|' <<< $RP)
- qdbus org.kde.amarok /Player org.freedesktop.MediaPlayer.Pause 1>//dev/null
- OUTPUT="$(date) [$USER] $MSG"
- kdialog --passivepopup "$OUTPUT"
- echo $OUTPUT
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement