Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use it? #1

Open
lockheed opened this issue Feb 28, 2014 · 5 comments
Open

How to use it? #1

lockheed opened this issue Feb 28, 2014 · 5 comments

Comments

@lockheed
Copy link

It seems like a great tool, but there is no information how to use it. In arch, starting the service creates the folder "/etc/connman-dispatcher" which I suppose is where the scripts should go.

But how are they supposed to be named? In what folders? There must be some way for the service to differentiate between scripts that are to be run on connect, and on disconnect, etc.

Please, provide some info.

@a-sk
Copy link
Owner

a-sk commented Mar 1, 2014

I updated the readme file, check it out and tell if you still have questions.

@lockheed
Copy link
Author

lockheed commented Mar 1, 2014

Great. But it says "connman-dispatcher -p /etc/connman-dispatcher"
How does it work with connman-dispatcher as a systemd service?

@a-sk
Copy link
Owner

a-sk commented Mar 1, 2014

When you run it with a default systemd unit file, it is run like this:

/usr/bin/connman-dispatcher -p /etc/connman-dispatcher

so every script in /etc/connman-dispatcher is executed as it's said in the readme file.

Did I answer your question, because I'm not sure if I understood you correctly.

@lockheed
Copy link
Author

lockheed commented Mar 1, 2014

Thanks. I did some tests, and it indeed runs some simple scripts, like that one:

#! /bin/sh
up() {
touch /lalalala
}

down() {
touch /lalala2
}

state="$1"

case $state in
    up)
        up
        ;;
    down)
        down
        ;;
esac

but it doesn't run a more complex script, like this one:

#! /bin/sh
up() {
    echo secretpass | sshfs [email protected]:public_html /mnt/larum/ -p 16969 -o workaround=rename -o password_stdin
}

down() {
    fusermount -u /mnt/larum/
}

state="$1"

case $state in
    up)
        up
        ;;
    down)
        down
        ;;
esac

or

#! /bin/sh
up() {
mount -tbitcasa [email protected] /mnt/bitcasa -o password=test123
}

down() {
    umount /mnt/bitcasa
    umount /mnt/bitcasa2
}

state="$1"

case $state in
    up)
        up
        ;;
    down)
        down
        ;;
esac

Do you know why it could be so?

@a-sk
Copy link
Owner

a-sk commented Mar 1, 2014

If you run it using systemd, you can check it's output by running:

sudo journalctl -b -u connman-dispatcher 

And of course, you can just run it from the command line and see the output immediately.

Repository owner deleted a comment from Soumya6Tiwari Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants