Automatic Bluetooth Mouse Script

Need help with C, C++, perl, python, etc?

Automatic Bluetooth Mouse Script

Postby Neelosh » 2006-12-07 02:54

i was hoping that i could write a perl script that would automatically configure my bluetooth mouse and make it work each time. the commands i need to type are "hcidtool scan" and then as root "hidd --server" followed by "hidd --connect " followed by my mouses address. i can't figure out a way to become a root. i had a simple script

#/usr/lib/perl -w

system("hcidtool scan");
system("hidd --server");
system("hidd --connect 00:07:61:4c:7b:ad");

but it obviously doesnt work. is there another way to do this?
Neelosh
 
Posts: 3
Joined: 2006-11-24 02:50

Postby marwal » 2006-12-07 08:56

You could SUID the script.
chmod u+s the-script
sudo chown root:root the-script

it then runs with the priviliges of the script-owner (root).
marwal
 
Posts: 14
Joined: 2006-11-17 07:26


Return to Programming

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable