PuppyThis forum is for the discussion of Puppy Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
For some reason, this only works from a konsole using FatDog.
It does not work when run from a File Manager.
Same script works fine with Puppy 5.6. using Thunar, etc.
Code:
# Linux Puppy 6.5.0 and FatDog
# Cpu_Temp.sh Show CPU temperatures (duo core in my case)
# "echo" creates a newline in a text file
#
# 1st check if sensors is installed
cd /
cd root/my-applications/lm_sensors-3.3.5/prog/sensors
date "+DATE: %m/%d/%y%nTIME: %r" >> cpu_temp.txt
echo >> cpu_temp.txt
sensors -f >> cpu_temp.txt
geany cpu_temp.txt
This may be a problem with different PATHs being available in the various places you start the script. Try giving the full file name when you invoke the sensors and geany commands.
...also I would rewrite the script as a proper shell script:
Code:
#!/bin/bash --
# Uncomment for debug output when testing:
# set -vxe
# Set default behaviour:
LANG=C; LC_ALL=C; export LANG LC_ALL
# Check if lm_sensors is installed:
which sensors >/dev/null 2>&1 || { echo "lm_sensors not installed, exiting."; exit 127; }
# Check if logger is installed (see 'man logger'):
which logger >/dev/null 2>&1 || { echo "logger not installed, exiting."; exit 127; }
# Sensors should be properly installed, not in /root/my-applications/lm_sensors-3.3.5/prog/sensors!
# Loop over the lines of output and have logger inset it into syslog. This way you keep your data central,
# (for which you actually should use the SysV init script and service lm_sensor sprovides IMHO) and you get
# time stamps for free.
sensors -f | while read LINE; do logger -t sensors "${LINE}"; done
exit 0
Now you can save this script as say "/etc/cron.hourly/sensors.cron" and if you want to check the values open a terminal window and run say
I saved your script as .sh but it does the same as my script.
Note my script won't give you output the way your script does nor does it open geany for you. Also note you seem to have installed sensors in /root/my-applications/lm_sensors-3.3.5/prog/ instead of /usr/bin or /usr/local/bin. That is not how you should install applications and "/root/my-applications/lm_sensors-3.3.5/prog/" most definitely will not be in your
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.