We have moved to a new Sailfish OS Forum. Please start new discussions there.

Revision history [back]

click to hide/show revision 1
initial version

posted 2014-02-05 23:23:43 +0200

wlan / wifi reset without reboot

I have an icon "wlan reset" setup as following:

a file /usr/share/applications/wlan-reset.desktop containing:

[Desktop Entry]
Type=Application
Name=wlan reset
Exec=sh -c "exec /path/program"
Icon=icon-launcher-mad-developer

as devel-su created a script

#!/bin/sh
rmmod wlan
sleep 20
modprobe wlan

script with setuid bit:

chmod 4755 <script>

c code from setuid on shell scripts

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
   setuid( 0 );
   system( "/path/script" );
   return 0;
}

compile the program:

gcc <c code> -o <program>

program with setuid bit:

chmod 4755 <program>

et voila a wlan / wifi reset without rebooting

Advantage of the icon over the commandline is that wlan status icons gets updated.

wlan / wifi reset without reboot

I have an icon "wlan reset" setup as following:

a file /usr/share/applications/wlan-reset.desktop containing:

[Desktop Entry]
Type=Application
Name=wlan reset
Exec=sh -c "exec /path/program"
Icon=icon-launcher-mad-developer

as devel-su created a script

#!/bin/sh
rmmod wlan
sleep 20
modprobe wlan

script with setuid bit:

chmod 4755 <script>

c code from setuid on shell scripts

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
   setuid( 0 );
   system( "/path/script" );
   return 0;
}

compile the program:

gcc <c code> -o <program>

program with setuid bit:

chmod 4755 <program>

et voila a wlan / wifi reset without rebooting

Advantage of Both with the icon over and the commandline is that wlan status icons gets most of the time does not get updated.

wlan / wifi reset without reboot

I have an icon "wlan reset" setup as following:

a file /usr/share/applications/wlan-reset.desktop containing:

[Desktop Entry]
Type=Application
Name=wlan reset
Exec=sh -c "exec /path/program"
Icon=icon-launcher-mad-developer

as devel-su created a script

#!/bin/sh
rmmod wlan
sleep 20
modprobe wlan

script with setuid bit:

chmod 4755 <script>

c code from setuid on shell scripts

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
   setuid( 0 );
   system( "/path/script" );
   return 0;
}

compile the program:

gcc <c code> -o <program>

program with setuid bit:

chmod 4755 <program>

et voila a wlan / wifi reset without rebooting

Both with the icon and the commandline is that wlan status icons most of the time does not get updated.

wlan / wifi reset without reboot

I have an icon "wlan reset" setup as following:

a file /usr/share/applications/wlan-reset.desktop containing:

[Desktop Entry]
Type=Application
Name=wlan reset
Exec=sh -c "exec /path/program"
Icon=icon-launcher-mad-developer

as devel-su created a script

#!/bin/sh
rmmod wlan
sleep 20
modprobe wlan

script with setuid bit:

chmod 4755 <script>

c code from setuid on shell scripts

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
   setuid( 0 );
   system( "/path/script" );
   return 0;
}

compile the program:

gcc <c code> -o <program>

program with setuid bit:

chmod 4755 <program>

et voila a wlan / wifi reset without rebooting

Both with the icon and the commandline is that wlan status icons most of the time does not get updated.