script to shutdown from Windows

  • Hi all,
    I'd like to write a script ( .bat dos file for example ) to shutdown OMV machine from windows 7 client without access from putty or from webgui but really don't know how to do it
    anyone who has some idea where to start from?
    Thanks

    • Offizieller Beitrag

    Without ssh or a dangerous custom written php script, there aren't going to be a lot of options. Why shutdown from Win7? The autoshutdown plugin can shutdown the system when you aren't using it.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.6 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Hello Guys,


    I had have the same problem and the only one solution was scritpting with putty.
    It works perfect. I have a script what wake´s up my NAS and a second one witch shutdown the NAS when I start Windows 7 or shut it down.
    Some of these plugins are not working properly, so I don´t want to waste my time.


    If you want, I can send the files as a package or place here the plaintext....


    Regards
    Kai from Germany

    OMV Erasmus 3.0.99| HP Microserver N54L | 8GB RAM | 20GB Intel SSD | 5 x 1TB in RAID5 | 8 TB ext. Backup Drive USB

  • The autoshutdown plugin is working. Read this: If Autoshutdown doesn't work ...
    What do want to achieve?


    Which plugins are not working properly ?


    Please post your detailed problem and we can help.


    Please share your scripts with us, also. Thx

  • anyway,
    after some google search that's a dos .bat script that perfectly works from windows 7:


    Code
    @echo off
    echo OMV server shutdown script
    c:\Programmi\putty\plink -v -ssh -P 22 root@OMVip_address -pw your_root_password "/sbin/shutdown -h now"
    PAUSE


    where "plink" is a programm provided in putty packet
    I know it's not so secure at the moment but it's a starting point for me

  • You can let the autoshutdown-script watch for "ip_address" also. If it is not reachable, OMV will shutdown
    http://forums.openmediavault.o…oshutdown-works-v0-2-pdf/

  • Here is the "down" script:
    --------------
    @echo off
    cls
    start c:\windows\putty_down -ssh 10.11.12.30 -l root -pw xxxxx -m C:\windows\putty_down.txt
    exit


    Content of "putty_down.txt"
    pm-hibernate -h now
    exit
    exit
    --------------


    Here is the "start" script:
    --------------
    c:\windows\putty_wol 38eaa7abf95b >> c:\windows\putty_fehler.txt


    Content of "putt_fehler.txt"
    Wake-up packet sent successfully.
    Wake-On-LAN Utility 1.10
    Copyright (C) 2000-2013 by Greg Wittmeyer - All Rights Reserved
    --------------


    Putty_wol is putty himself and was renamed to get out of trouble anyway.
    I have installed most of these plgins above, but they won´t work or are not useful.


    Hope this has helped you!!!

    OMV Erasmus 3.0.99| HP Microserver N54L | 8GB RAM | 20GB Intel SSD | 5 x 1TB in RAID5 | 8 TB ext. Backup Drive USB

    Einmal editiert, zuletzt von Mr.President ()

  • Ich hab vor einigen Tagen ein "apt-get update, upgrad, dist-upgrade" gefahren und bekomme seitdem im WebInterface unter Update Manager keine Aktualisierugnen mehr.
    Es wird gesucht und gesucht, aber nichts passiert. Hat Jemand eine unkomplizierte Idee?


    Um heraus zufinden, welche Pakete installiert wurden, hab ich folgendes Kommando versucht: ls /var/lib/dpkg/info -cl | grep "Feb 25" (ist der Tag, an dem ich obiges Kommando ausgeführt habe)
    Unter meinem debian funktioniert dieses Kommando perfekt, unter OMV leider nicht bzw. nur einzelnd. In Kombi mit grep erfolgt keine Ausgabe.
    Aktuell fahre ich Kralizec in der Version 1.13 und würde gerne einiges aktualisieren....



    Gruß Kai

    OMV Erasmus 3.0.99| HP Microserver N54L | 8GB RAM | 20GB Intel SSD | 5 x 1TB in RAID5 | 8 TB ext. Backup Drive USB

  • versuchs mal ohne grep und schau dir die liste an. Ggf. das "Feb 25" anpassen
    Bei mir funktioniert der Befehl ohne probleme. Vielleicht war es nicht der 25. Februar?

  • Doch doch, es war der 25. Februar. Aber unabhängig vom Ergebnis des Kommandos kann ich per Wbinterface kein Repository aufbauen.
    Die Ausgabe ohne grep gibt ein nicht verwertbares Ergebnis. Es werden einfach keine Pakete gefunden, DAS ist das Problem....

    OMV Erasmus 3.0.99| HP Microserver N54L | 8GB RAM | 20GB Intel SSD | 5 x 1TB in RAID5 | 8 TB ext. Backup Drive USB

  • Code
    ls /var/lib/dpkg/info -qaltr


    Gruß
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • Danke für das Kommando, aber es hilft mir leider noch weniger weiter.
    Der springende Punkt sind nicht letztendlich die Pakete, sondern warum habe ich ein leeres Repository.
    Das dieser Effekt NACH der Installation der Pakete bzw. dem Update aufgetreten ist, steht ja fest....

    OMV Erasmus 3.0.99| HP Microserver N54L | 8GB RAM | 20GB Intel SSD | 5 x 1TB in RAID5 | 8 TB ext. Backup Drive USB

  • Er hilft deiner ursprünglichen Frage sehr wohl weiter, nämlich siehst du so auf einen Blick und ohne große Probleme welche Pakete zuletzt aktuallisiert wurden.


    Was passiert denn wenn du apt-get update && apt-get upgrade ausführst?


    Gruß
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • Ok, aber wie soll ich erkennen, welches Paket, wenn es denn so ist, dieses Problem verursacht hat?
    Im Übrigen habe ich ja "apt-get update && apt-get upgrade && apt-get dist-upgrade && apt-get autoclean" am 25.02. erst ausgeführt....


    Habe obiges Kommando erneut ausgeführt, ohne Erfolg!!

    OMV Erasmus 3.0.99| HP Microserver N54L | 8GB RAM | 20GB Intel SSD | 5 x 1TB in RAID5 | 8 TB ext. Backup Drive USB

  • Ok, aber wie soll ich erkennen, welches Paket, wenn es denn so ist, dieses Problem verursacht hat?


    Wohl eher gar nicht. Ich habe blos deine Frage beantwortet wie du die Auflistung in richtige Reihenfolge bekommst.


    Im Übrigen habe ich ja "apt-get update && apt-get upgrade && apt-get dist-upgrade && apt-get autoclean" am 25.02. erst ausgeführt....


    Kann es vllt. sein dass es auch am 25.02. keine Updates gabe? Und heute eben auch nicht?!


    Habe obiges Kommando erneut ausgeführt, ohne Erfolg!!


    Was bedeutet für dich "ohne erfolg"? Könntest du mal die gesamte Ausgabe hier, in einem Code Block, posten?


    Gruß
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • Die Ausgabe ohne grep gibt ein nicht verwertbares Ergebnis.


    Du kannst doch zurückscrollen oder? Zur Not auch erstmal ein

    Code
    grep "Feb"
  • Solo0815: mein erstes Kommando mit ".... | grep "Feb 25"" ergibt sehr wohl genau die Ausgabe die gewünscht wird, auf meinem System hier.
    Nur innerhalb des OMV leider nicht. Bei allen Freunden usw. gleichfalls die erfolgreiche Auflistung der nur zuletzt installierten Pakete.


    davidh2k: dochh, am 25. habe ich ja das von mir zuletzt aufgeführte Kommando ausgeführt. Und eben danach lies sich der Würfel nicht mehr in den Hibernate fahren.
    Am nächsten Abend lief alles wieder wie von Geisterhand, bis eben auf das leere Repository im Webinterface des OMV. "Ohne Erfolg" heißt, es wurden keine Updates gezogen!!


    -----------------------------------
    Also, es wurden:


    libcups2**** (Anzahl 6)
    libgeoip1**** (Anzahl 4)
    libnewt0.52**** (Anzahl 4)
    whiptail (Anzahl 1)



    aktualisiert

    OMV Erasmus 3.0.99| HP Microserver N54L | 8GB RAM | 20GB Intel SSD | 5 x 1TB in RAID5 | 8 TB ext. Backup Drive USB

  • Nur innerhalb des OMV leider nicht. Bei allen Freunden usw. gleichfalls die erfolgreiche Auflistung der nur zuletzt installierten Pakete.


    Dann würde ich (so frei bin ich mal) behaupten dass auf deinem OpenMediaVault system am 25. Ferbuar keine Updates installiert wurden.


    "Ohne Erfolg" heißt, es wurden keine Updates gezogen!!


    Dann sind auch keine da.


    Gruß
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!