Run BASH and command on boot

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
raddatzjos

Run BASH and command on boot

Post by raddatzjos »

I'm running Mint 11 on a laptop with a temperature sensor issue. Linux doesn't always read the sensor and outputs out a value of 0 Celsius, and thus it will never turn the fans on. Normally this would be a problem, but a quick restart usually fixes the problem and the fan will turn on as needed because it's properly reading the data.

Now that you have some relevant information, is there a way to open a terminal and have it run the sensors command every time I start my laptop? I would like to do this because once I know the sensor isn't reading 0, I know it will work at least until I shut down my laptop again. If someone knows of a simpler method, that would be appreciated too. And finally, if this is miscategorized, I'm sorry.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
thaimann

Re: Run BASH and command on boot

Post by thaimann »

I think Anacron can do this. It's an updated version of cron.

TH
chammer

Re: Run BASH and command on boot

Post by chammer »

In some distributions there's an local or local.start script under /etc/default, /etc/conf.d, or /etc/init.d. However, after a bit of searching I was unable to locate one in Mint. However, this should set you on the right track of making your own: https://help.ubuntu.com/community/RcLocalHowto
awi
Level 1
Level 1
Posts: 13
Joined: Wed Nov 23, 2011 8:23 pm
Location: Asunción, Paraguay
Contact:

Re: Run BASH and command on boot

Post by awi »

Yo can use

Code: Select all

 /etc/rc.local 
Linux Mint 12 default looks like these

Code: Select all

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0
Locked

Return to “Scripts & Bash”