(sort of) fixes #8
This commit is contained in:
parent
3551dcc3c4
commit
a6cc7a45b6
5 changed files with 28 additions and 8 deletions
7
Makefile
7
Makefile
|
@ -54,6 +54,13 @@ clean:
|
||||||
|
|
||||||
install:
|
install:
|
||||||
cp $(EXE) /usr/sbin
|
cp $(EXE) /usr/sbin
|
||||||
|
@echo "-----------------------------------------------------------------------------"
|
||||||
|
@echo "An init file suitable for /lib/lsb/init-functions (Debian & Ubuntu fur sure)"
|
||||||
|
@echo "Is located in the main folder of the source files. It is called mbpfan.init."
|
||||||
|
@echo "Rename it to mbpfan, give it execution permissions (chmod +x mbpfan)"
|
||||||
|
@echo "and move it to /etc/init.d"
|
||||||
|
@echo "Then, add it to the default runlevels with sudo update-rc.d mbpfan defaults"
|
||||||
|
@echo "-----------------------------------------------------------------------------"
|
||||||
|
|
||||||
rebuild: clean all
|
rebuild: clean all
|
||||||
#rebuild is not entirely correct
|
#rebuild is not entirely correct
|
||||||
|
|
19
README.md
19
README.md
|
@ -29,16 +29,29 @@ Install Instructions
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
Install with
|
Install with
|
||||||
make install
|
sudo make install
|
||||||
|
|
||||||
|
It actually copies mbpfan to /usr/sbin.
|
||||||
|
|
||||||
|
An init file suitable for /lib/lsb/init-functions (Debian & Ubuntu fur sure)
|
||||||
|
Is located in the main folder of the source files. It is called mbpfan.init.
|
||||||
|
Rename it to mbpfan, give it execution permissions (chmod +x mbpfan)
|
||||||
|
and move it to /etc/init.d
|
||||||
|
Then, add it to the default runlevels with sudo update-rc.d mbpfan defaults (Ubuntu example)
|
||||||
|
|
||||||
It actually copies mbpfan to /usr/sbin,
|
|
||||||
|
|
||||||
Run Instructions
|
Run Instructions
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
Run with
|
If not installed, run with
|
||||||
sudo bin/mbpfan
|
sudo bin/mbpfan
|
||||||
|
|
||||||
|
If installed, manually run with
|
||||||
|
sudo mbpfan
|
||||||
|
|
||||||
|
If installed and using the init file, run with (Ubuntu example)
|
||||||
|
sudo service mbpfan start
|
||||||
|
|
||||||
|
|
||||||
License
|
License
|
||||||
---------------------
|
---------------------
|
||||||
|
|
|
@ -85,7 +85,7 @@ void signal_handler(int signal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void go_daemon(void (*mbpfan)())
|
void go_daemon(void (*fan_control)())
|
||||||
{
|
{
|
||||||
|
|
||||||
// Setup signal handling before we start
|
// Setup signal handling before we start
|
||||||
|
@ -168,7 +168,7 @@ void go_daemon(void (*mbpfan)())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mbpfan();
|
fan_control();
|
||||||
|
|
||||||
if(daemonize){
|
if(daemonize){
|
||||||
syslog(LOG_INFO, "%s daemon exiting", program_name);
|
syslog(LOG_INFO, "%s daemon exiting", program_name);
|
||||||
|
|
|
@ -62,7 +62,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
// pointer to mbpfan() function in mbpfan.c
|
// pointer to mbpfan() function in mbpfan.c
|
||||||
void (*mbpfan)() = mbpfan;
|
void (*fan_control)() = mbpfan;
|
||||||
go_daemon(mbpfan);
|
go_daemon(fan_control);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
|
@ -52,7 +52,7 @@ int low_temp = 63; // try ranges 55-63
|
||||||
int high_temp = 66; // try ranges 58-66
|
int high_temp = 66; // try ranges 58-66
|
||||||
int max_temp = 86; // do not set it > 90
|
int max_temp = 86; // do not set it > 90
|
||||||
|
|
||||||
int polling_interval = 5;
|
int polling_interval = 7;
|
||||||
|
|
||||||
|
|
||||||
struct s_sensors {
|
struct s_sensors {
|
||||||
|
|
Loading…
Reference in a new issue