* [PATCH] alsa-info.sh - Check if pastebin.ca is up, and gracefully fallback to --no-upload if its down.
@ 2008-06-04 13:40 Travis Place
2008-06-04 14:01 ` Maxim Levitsky
0 siblings, 1 reply; 2+ messages in thread
From: Travis Place @ 2008-06-04 13:40 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 530 bytes --]
Changelog: This patch will allow alsa-info.sh to check if the
pastebin site
(www.pastebin.ca) is down, before trying to upload to it. It
will fail
gracefully, with a message letting the user know what happened.
The script
will also keep the ALSA information it collected (same way it
does
with --no-upload).
Patch is attached.
Signed-off-by: Travis Place <wishie at wishie dot net>
[-- Attachment #2: alsa-info.sh-0.4.45.patch --]
[-- Type: text/x-patch, Size: 3097 bytes --]
diff -r 2ea9a8a108ea alsa-info.sh
--- a/alsa-info.sh Mon May 19 18:29:17 2008 +0200
+++ b/alsa-info.sh Fri May 23 04:06:32 2008 +1000
@@ -1,6 +1,6 @@
#!/bin/bash
-SCRIPT_VERSION=0.4.44
+SCRIPT_VERSION=0.4.45
CHANGELOG="http://hg.alsa-project.org/alsa/log/tip/alsa-info.sh"
#################################################################################
@@ -31,6 +31,10 @@ BGTITLE="ALSA-Info v $SCRIPT_VERSION"
BGTITLE="ALSA-Info v $SCRIPT_VERSION"
PASTEBINKEY="C9cRIO8m/9y8Cs0nVs0FraRx7U0pHsuc"
#Define some simple functions
+
+pbcheck(){
+ [[ $(ping -c1 www.pastebin.ca) ]] || KEEP_FILES="yes" NOUPLOAD="yes" PBERROR="yes"
+}
update() {
wget -O /tmp/alsa-info.sh http://hg.alsa-project.org/alsa/raw-file/tip/alsa-info.sh >/dev/null 2>&1
@@ -190,7 +194,6 @@ SNDOPTIONS=$(modprobe -c|sed -n 's/^opti
QUESTION="yes"
PROCEED="yes"
-NOUPLOAD=""
REPEAT=""
while [ -z "$REPEAT" ]; do
REPEAT="no"
@@ -411,9 +414,7 @@ then
withamixer
withalsactl
withlsmod
- #Workaround, while we sort out pastebin location, since pastebin.ca blocked us.
- #NOUPLOAD="yes"
-
+ pbcheck
fi
fi # proceed
@@ -457,17 +458,6 @@ then
withalsactl
withlsmod
;;
- #### FIX ME
- --secure)
- withdevices
- withconfigs
- withaplay
- withamixer
- withalsactl
- withlsmod
- withsecure
- ;;
- ###########
--with-aplay)
withaplay
;;
@@ -598,7 +588,11 @@ if [[ -n $DIALOG ]]
if [[ -n $DIALOG ]]
then
if [[ -n $NOUPLOAD ]]; then
- dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "You requested that your information was NOT automatically uploaded to the pastebin\n\nYour ALSA information can be seen by looking in $FILE" 10 100
+ if [[ -n $PBERROR ]]; then
+ dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occured while contacting the pastebin. Your information was NOT automatically uploaded.\n\nYour ALSA information can be seen by looking in $FILE" 10 100
+ else
+ dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "You requested that your information was NOT automatically uploaded to the pastebin\n\nYour ALSA information can be seen by looking in $FILE" 10 100
+ fi
else
dialog --backtitle "$BGTITLE" --title "Information uploaded" --yesno "Would you like to see the uploaded information?" 5 100
DIALOG_EXIT_CODE=$?
@@ -610,10 +604,17 @@ fi
fi
clear
if [[ -n $NOUPLOAD ]]; then
- echo "You requested that your information was NOT automatically uploaded to the pastebin"
- echo ""
- echo "Your ALSA information can be seen by looking in $FILE"
- echo ""
+ if [[ -n $PBERROR ]]; then
+ echo "An error occured while contacting the pastebin. Your information was NOT automatically uploaded."
+ echo ""
+ echo "Your ALSA information can be seen by looking in $FILE"
+ echo ""
+ else
+ echo "You requested that your information was NOT automatically uploaded to the pastebin"
+ echo ""
+ echo "Your ALSA information can be seen by looking in $FILE"
+ echo ""
+ fi
fi
if [[ -z $NOUPLOAD ]]; then
echo "Your ALSA information is located at $FINAL_URL"
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] alsa-info.sh - Check if pastebin.ca is up, and gracefully fallback to --no-upload if its down.
2008-06-04 13:40 [PATCH] alsa-info.sh - Check if pastebin.ca is up, and gracefully fallback to --no-upload if its down Travis Place
@ 2008-06-04 14:01 ` Maxim Levitsky
0 siblings, 0 replies; 2+ messages in thread
From: Maxim Levitsky @ 2008-06-04 14:01 UTC (permalink / raw)
To: Travis Place; +Cc: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 857 bytes --]
Travis Place wrote:
> Changelog: This patch will allow alsa-info.sh to check if the
> pastebin site
> (www.pastebin.ca) is down, before trying to upload to it. It
> will fail
> gracefully, with a message letting the user know what happened.
> The script
> will also keep the ALSA information it collected (same way it
> does
> with --no-upload).
>
> Patch is attached.
>
> Signed-off-by: Travis Place <wishie at wishie dot net>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
You mean this message,
your patch attached.
[-- Attachment #2: alsa-info.sh-0.4.45.patch --]
[-- Type: text/x-diff, Size: 3097 bytes --]
diff -r 2ea9a8a108ea alsa-info.sh
--- a/alsa-info.sh Mon May 19 18:29:17 2008 +0200
+++ b/alsa-info.sh Fri May 23 04:06:32 2008 +1000
@@ -1,6 +1,6 @@
#!/bin/bash
-SCRIPT_VERSION=0.4.44
+SCRIPT_VERSION=0.4.45
CHANGELOG="http://hg.alsa-project.org/alsa/log/tip/alsa-info.sh"
#################################################################################
@@ -31,6 +31,10 @@ BGTITLE="ALSA-Info v $SCRIPT_VERSION"
BGTITLE="ALSA-Info v $SCRIPT_VERSION"
PASTEBINKEY="C9cRIO8m/9y8Cs0nVs0FraRx7U0pHsuc"
#Define some simple functions
+
+pbcheck(){
+ [[ $(ping -c1 www.pastebin.ca) ]] || KEEP_FILES="yes" NOUPLOAD="yes" PBERROR="yes"
+}
update() {
wget -O /tmp/alsa-info.sh http://hg.alsa-project.org/alsa/raw-file/tip/alsa-info.sh >/dev/null 2>&1
@@ -190,7 +194,6 @@ SNDOPTIONS=$(modprobe -c|sed -n 's/^opti
QUESTION="yes"
PROCEED="yes"
-NOUPLOAD=""
REPEAT=""
while [ -z "$REPEAT" ]; do
REPEAT="no"
@@ -411,9 +414,7 @@ then
withamixer
withalsactl
withlsmod
- #Workaround, while we sort out pastebin location, since pastebin.ca blocked us.
- #NOUPLOAD="yes"
-
+ pbcheck
fi
fi # proceed
@@ -457,17 +458,6 @@ then
withalsactl
withlsmod
;;
- #### FIX ME
- --secure)
- withdevices
- withconfigs
- withaplay
- withamixer
- withalsactl
- withlsmod
- withsecure
- ;;
- ###########
--with-aplay)
withaplay
;;
@@ -598,7 +588,11 @@ if [[ -n $DIALOG ]]
if [[ -n $DIALOG ]]
then
if [[ -n $NOUPLOAD ]]; then
- dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "You requested that your information was NOT automatically uploaded to the pastebin\n\nYour ALSA information can be seen by looking in $FILE" 10 100
+ if [[ -n $PBERROR ]]; then
+ dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occured while contacting the pastebin. Your information was NOT automatically uploaded.\n\nYour ALSA information can be seen by looking in $FILE" 10 100
+ else
+ dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "You requested that your information was NOT automatically uploaded to the pastebin\n\nYour ALSA information can be seen by looking in $FILE" 10 100
+ fi
else
dialog --backtitle "$BGTITLE" --title "Information uploaded" --yesno "Would you like to see the uploaded information?" 5 100
DIALOG_EXIT_CODE=$?
@@ -610,10 +604,17 @@ fi
fi
clear
if [[ -n $NOUPLOAD ]]; then
- echo "You requested that your information was NOT automatically uploaded to the pastebin"
- echo ""
- echo "Your ALSA information can be seen by looking in $FILE"
- echo ""
+ if [[ -n $PBERROR ]]; then
+ echo "An error occured while contacting the pastebin. Your information was NOT automatically uploaded."
+ echo ""
+ echo "Your ALSA information can be seen by looking in $FILE"
+ echo ""
+ else
+ echo "You requested that your information was NOT automatically uploaded to the pastebin"
+ echo ""
+ echo "Your ALSA information can be seen by looking in $FILE"
+ echo ""
+ fi
fi
if [[ -z $NOUPLOAD ]]; then
echo "Your ALSA information is located at $FINAL_URL"
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-04 14:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-04 13:40 [PATCH] alsa-info.sh - Check if pastebin.ca is up, and gracefully fallback to --no-upload if its down Travis Place
2008-06-04 14:01 ` Maxim Levitsky
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.