Sponsored Content
Operating Systems Linux Ubuntu Check for download before running command Post 303032837 by wisecracker on Monday 25th of March 2019 05:18:49 AM
Old 03-25-2019
Hi drew...

Tell us what your project is or what you are trying to achieve then perhaps we can help you with it as a complete proper entity.

Some of the snippet code threads you have started are not portable at all, 'xinput' for example will not work on at least APPLE gear and CygWin for Windows as they don't have it.
'systemctl' will not work on many *NIX like flavours as they don't have it either. I can't test any of your code on this MacBook Pro without rebooting into Linux Mint 19.
This can become tedious...

EDIT:
Just checked and Linux Mint 19 does NOT have 'xprintidle' either on a default install.

Last edited by wisecracker; 03-25-2019 at 06:58 AM.. Reason: See EDIT:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Check if deamons are running

Does anyone know if there is a UNIX-tool available that constantly will check if (some specific) deamons are running and will notify (via email) if one has failed/stopped? I searched the web, but so far didn't find anything. (3 Replies)
Discussion started by: W2W
3 Replies

2. Shell Programming and Scripting

Check if Process is running

Hi , I have a csh code below which check the process if it's running. Can any expert advise me on the following: 1) what does this notationmean ">!" and how is it different from the append ">" notation ? 2) how does "setenv" work in this code ? # Check whether there is a running... (3 Replies)
Discussion started by: Raynon
3 Replies

3. UNIX and Linux Applications

How to check if process is running?

Hi I would like to check if an instance of a script is already running. I've seen many different examples, but I haven't the slightest idea as to how to do this. Can you please help. Thank you. (5 Replies)
Discussion started by: ladyAnne
5 Replies

4. UNIX for Dummies Questions & Answers

Command to check if a particular process is running

Hi What is the best command to check if a particular process is running in a linux server or not To check any java process, I use the below command. ps -ef |grep jvm When I execute the above command, it lists me all the processess . The above command should ideally return only the... (6 Replies)
Discussion started by: vr3w3c9
6 Replies

5. Shell Programming and Scripting

Check what cron is running

How to check what cron is scheduled to run? I don't want to modify anything. Thanks (1 Reply)
Discussion started by: stevensw
1 Replies

6. Shell Programming and Scripting

Check email and download attachment

Hi, I had search the web for a script to download email, but failed to found one. I need a bash or perl script that will check for email originating from an address such as john@rambo.com and download the .zip attachment into a specified folder. Anyone could assist or give me some... (1 Reply)
Discussion started by: mynullvoid
1 Replies

7. Shell Programming and Scripting

Check to see if script is already running

Happy New Year Is there a quick way to check to see if a script is already running. I want to put in a check in the script to exit, if already running. Currerntly i can only think of doing it the following way. # ps -ef | grep -i 3_HOUSEKEEPING_FFTVTL_TO_FFTDSSU_DUPLICATION.ksh |... (5 Replies)
Discussion started by: Junes
5 Replies

8. Shell Programming and Scripting

Command to check only Autosys running jobs with autorep like command

Hi, Is there any specific command to use to check only say Running jobs via autorep or similar command for Autosys? (0 Replies)
Discussion started by: sidnow
0 Replies

9. Shell Programming and Scripting

Check if remote destination is available before running scp command

I have a script on a Linux box which scp the files to windows server without any issues. but there are time frames where the windows server will not be available due to maintenance. hence I need to check if the remote location is available before running the scp command. scp... (3 Replies)
Discussion started by: gpk_newbie
3 Replies

10. Shell Programming and Scripting

Check if process is running if not then use command

Hello, Could someone do the following bash ubuntu script for me? I have 5 screen processes of bot: SCREEN -dmS Xbot_instance_1 php core.php -i 1 SCREEN -dmS Xbot_instance_2 php core.php -i 2 SCREEN -dmS Xbot_instance_3 php core.php -i 3 SCREEN -dmS Xbot_instance_4 php core.php -i 4 ... (2 Replies)
Discussion started by: kotch
2 Replies
ASMC(4) 						   BSD Kernel Interfaces Manual 						   ASMC(4)

NAME
asmc -- device driver for the Apple System Management Console (SMC) SYNOPSIS
To compile this driver into the kernel, place the following line in your kernel configuration file: device asmc Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): asmc_load="YES" DESCRIPTION
The asmc driver controls the Apple System Management Console (SMC for short) found on Intel Apple systems. The SMC is known to be found on the following systems: o MacBook o MacBook Pro o Intel MacMini o Mac Pro o MacBook Air o Intel iMac With this driver, you can configure your keyboard backlight brightness, check temperatures of several sensors, check the speed of the inter- nal fans and check the status of the Sudden Motion Sensor. Variables related to the SMC control and inspection are exported via sysctl(3) under the device tree dev.asmc. KEYBOARD BACKLIGHT
On MacBook Pro systems, you can control the keyboard brightness by writing a value to the dev.asmc.%d.light.control sysctl MIB. The following sysctl MIBs contains the raw value returned by the left and right light sensors: dev.asmc.%d.light.left or dev.asmc.%d.light.right. TEMPERATURES
The number of temperature sensors and their description varies among systems. You can inspect the temperature sensors on your system by traversing the dev.asmc.temp sysctl MIB. All values are in degrees celsius. SYSTEM FANS
The dev.asmc.fan.%d sysctl tree contains the leaf nodes speed, safespeed, minspeed, maxspeed and targetspeed. Each of these leaf nodes rep- resent the current fan speed, the safest minimum fan speed, the mininum speed and the maximum speed respectively. All values are in RPM. SUDDEN MOTION SENSOR
The Sudden Motion Sensor (SMS for short) is a device that detects laptop movement and notifies the operating system via an interrupt. The sysctl MIBs present under dev.asmc.sms all relate to the SMS. The most interesting usage of this device is to park the disk heads when the laptop is moved harshly. First, you need to install ataidle(8) (ports/sysutils/ataidle) and then configure devd(8) the following way: notify 0 { match "system" "ACPI"; match "subsystem" "asmc"; action "/usr/local/sbin/ataidle -s X Y"; }; Do not forget to change the X and Y values in the command above. Also, please note that parking the disk heads too many times can dramatically reduce your hard drive's life span. Do not rely solely on the SMS to protect your hard drive: good care and common sense can increase your hard drive's life. SEE ALSO
ataidle(8) (ports/sysutils/ataidle), devd(8), sysctl(8) HISTORY
The asmc driver first appeared in FreeBSD 8.0. AUTHORS
Rui Paulo <rpaulo@FreeBSD.org> (Google Summer of Code project). BUGS
Support for the latest models was never tested and is most likely not fully working. BSD
July 27, 2009 BSD
All times are GMT -4. The time now is 06:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy