LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Kdialog problem & college network (https://www.linuxquestions.org/questions/linux-newbie-8/kdialog-problem-and-college-network-833115/)

SimianDysfunction 09-18-2010 06:42 PM

Kdialog problem & college network
 
I am running Kubuntu 10.04 and as part of the registration process for connecting to my college residences network, I have to download and run one of thosese retarded Bradford Dissolvable Agent, it is a bin file and when I execute it I get:

Code:

:~$ sudo sh Bradford_Dissolvable_Agent.bin
Bradford_Dissolvable_Agent.bin: 92: kdalog: not found
Bradford_Dissolvable_Agent.bin :: Unable to read policy

Now you can ignore the fact it says kdalog instead of kdialog, examining the bin file in kate shows it's just a typo.

I'm not entirely sure what to do regarding kdialog, I assume it is installed (it's there in /usr/bin/), does anyone have any idea how to troubleshoot this further, as I am all out of ideas?

Here is the first 100 or so lines of the script if anyone wants to take a look:
Code:

#!/bin/sh

errorMessage() # str title , str message
{
    title=$1
    message=$2
    if [ -x "`which zenity 2>/dev/null`" ]
    then
        zenity --title "$title" --error --text "$message"
    elif [ -x "`which kdialog 2>/dev/null`" ]
    then
        kdalog --title "$title" --error "$message"
    elif [ -x "`which xmessage 2>/dev/null`" ]
    then
        xmessage -center -buttons "OK" "$message"
    fi
    echo "$title :: $message"
}

lsb_release=/usr/bin/lsb_release

if [ -x "/bin/lsb_release" ]
then
 lsb_release=/bin/lsb_release
fi
dlg_title=`basename $0`
if [ -x "$lsb_release" ]
then
    $lsb_release -v | grep -E "core-(3|4)\..-(ia32|x86_64|amd64)" >/dev/null
    if [ $? -eq 0 ]
    then
        SKIP=`awk '/^#__BEGIN_BINARY__/ { print NR +1; exit 0; }' "$0"`
        tail -n +$SKIP "$0" >"$0.bin"
        chmod +x "$0.bin"
        if [ -x /usr/bin/xdg-mime ]
        then
            defaultHTML="`/usr/bin/xdg-mime query default text/html 2>/dev/null`"
            browser=""
            if [ -z "$XDG_DATA_HOME" ]
            then
                XDG_DATA_HOME=$HOME/.local/share
            fi

            if [ -e $XDG_DATA_HOME/applications/preferred-web-browser.desktop ]
            then
                browser="preferred-web-browser"
            elif [ -e /usr/share/applications/mozilla-firefox.desktop ]
            then
                browser="mozilla-firefox"
            elif [ -e /usr/share/applications/iceweasel.desktop ]
            then
                browser="iceweasel"
            elif [ -e /usr/share/applications/konqueror.desktop ]
            then
                browser="konqueror"
            elif [ -e /usr/share/applications/epiphany.desktop ]
            then
                browser="epiphany"
            elif [ -e /usr/local/share/applications/opera.desktop ]
            then
                browser="opera"
            elif [ -e /usr/share/applications/mozilla-seamonkey.desktop ]
            then
                browser="mozilla-seamonkey"
            fi
           
            if [ -s "$browser" ]
            then
                /usr/bin/xdg-mime default $browser.desktop text/html 2>/dev/null
            fi
        fi
        if [ -x /usr/bin/xdg-mime ]
        then
            /usr/bin/xdg-mime default $defaultHTML text/html 2>/dev/null
        fi
        thedir="`dirname "$0"`"
        thefile="`basename "$0"`"
        error_message="$("$thedir/./$thefile.bin")"
        if [ $? -eq 0 ]
        then
            rm "$0"
            rm "$0.bin"
            exit
        else
            errorMessage "$thefile" "$error_message"
        fi
    else
        errorMessage "$dlg_title" "LSB 3.0 or higher not found.  Please install the appropriate LSB packages."
    fi
else
    errorMessage "$dlg_title" "$lsb_release not found.  Please install the appropriate LSB packages."
fi

#clean up intermediary file just in case
if [ -e "$0.bin" ]
then
    rm "$0.bin"
fi

exit

#__BEGIN_BINARY__#


{BBI}Nexus{BBI} 09-18-2010 06:59 PM

The 'typo' does matter. Try correcting it, then execute the file again.

SimianDysfunction 09-18-2010 08:22 PM

Hmm... my knowledge of bash scripting is limited, but from what I can tell it is just sending "kdalog" as output string for the error message? I shall give it a try though. Thanks!

SimianDysfunction 09-18-2010 08:33 PM

Actually, I can't do it... I know how to replace a hex value using vim, but how should I go about adding one? :redface:

{BBI}Nexus{BBI} 09-18-2010 08:37 PM

You should be able to make the change using a regular text editor. Kwrite should work.

SimianDysfunction 09-18-2010 08:41 PM

Nope, I have to use a hex editor of some type because it has binary in it and it will result in a corrupt file. I'll google for a bit to see...

{BBI}Nexus{BBI} 09-18-2010 08:52 PM

1 Attachment(s)
Quote:

Originally Posted by SimianDysfunction (Post 4102137)
Nope, I have to use a hex editor of some type because it has binary in it and it will result in a corrupt file. I'll google for a bit to see...

I don't get a corrupt file. The only error I get is about not having LSB 3.0 or higher and that's because I don't have LSB on my system. See screenshot.


All times are GMT -5. The time now is 06:06 PM.