This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UPS shutdown script

I did a search of this forum and found nothing so I did a bit of Googling but everything I did find leads me to think that there is no way I can do an ordered shutdown of my ASL box when the power goes pear shaped for an extended period of time.
I have an APC SmartUPS that I would like to configure to shutdown Astaro. Is this possible?
Any help or advice on this subject would be appreciated.


This thread was automatically locked due to age.
Parents
  • Hello Big0,

    i habe a answer for you,
    you must have a pc with usv-software, your usv software
    start a script on low power. in a script insert follow

    step 1
    pscp -2 -pw passwort drive:\path\shutdown.now loginuser@ip-adresse:/home/login

    this file copy on low power to astrao-firewall.
    the firewall check all 5min is file in dir, if file insert
    then del shutdown.now and stop a firewall.
    shutdown.now is a emty file.

    step2
    create a file shdown.sh with
    if [ -e "/home/login/shutdown.now" ]
      then
       rm /home/login/shutdown.now
       /sbin/halt
    fi

    step3
    create a file crontab.sdown with
    5,10,15,20,25,30,35,40,45,50,55,00 * * * * root /usr/local/bin/shdown.sh

    step4
    copy file shdown.sh and crontab.sdown too /home/login
    with winscp

    step5
    copy shdown.sh from /home/login too /usr/local/bin
    copy crontab.sdwon from /home/login too /etc

    step6
    chmod 777 /usr/local/bin/shdown.sh

    step7
    reboot your firewall an check a entry in /etc/crontab
    you must have a entry with
    5,10,.... root /usr/local/bin/shdown.sh

    i hope, i can help
  • [ QUOTE ]
    /sbin/halt

    [/ QUOTE ]

    /sbin/poweroff

    would be better

    Also, one should set their BIOS to power-on when AC back, or similar.

    Barry
Reply Children
No Data