The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > BSD
.
google unix.com



BSD BSD, sometimes called Berkeley Unix, is a Unix operating system developed by the Computer Systems Research Group of the UC Berkeley.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
About Battery Update 1.2 iBot OS X Support RSS 0 05-19-2009 02:30 PM
Getting same exit status for empty and non empty file mavesum UNIX for Dummies Questions & Answers 4 12-03-2008 09:59 AM
ibm san cache battery with aix itik AIX 2 05-15-2008 07:40 PM
Battery 1.01 (Default branch) iBot Software Releases - RSS News 0 05-12-2008 07:00 AM
how to find empty folders without using -empty lasse UNIX for Dummies Questions & Answers 7 01-17-2008 02:30 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
  #1 (permalink)  
Old 08-01-2009
ccc ccc is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 26
Battery Empty -> force shutdown

hi

Howto force shutdown on the notebook with freeBSD before battery is empty?
  #2 (permalink)  
Old 08-01-2009
nitin's Avatar
nitin nitin is offline
Registered User
  
 

Join Date: Aug 2001
Location: Toronto, ON
Posts: 88
Try 'shutdown now' or '/sbin/init 0'
  #3 (permalink)  
Old 08-01-2009
ccc ccc is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 26
Quote:
Originally Posted by nitin View Post
Try 'shutdown now' or '/sbin/init 0'
I mean to shutdown automaticaly from script, cron etc.

Last edited by ccc; 08-04-2009 at 10:07 AM..
  #4 (permalink)  
Old 08-06-2009
ccc ccc is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 26
Code:
#!/bin/csh
# /usr/local/sbin/batterytest
# Baterry control
 
set restminutes=`/sbin/sysctl -n hw.acpi.battery.time`
set modus=`/sbin/sysctl -n hw.acpi.battery.state`
 
# does it have Power Supply connected?
if ( "${modus}" == "1" ) then
 
  # 7 Minutes?
  if ( "${restminutes}" < "7" ) then
    shutdown -p +2 "The Battery is empty! The Computer will shutdown after 2 Minutes!" &
  endif

endif
Code:
# chown root /usr/local/sbin/batterytest
# chmod u+x /usr/local/sbin/batterytest
add to crontab:
Code:
*/5 * * * * /usr/local/sbin/batterytest
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:28 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0