Für was sind die Befehle?
Homebridge-wol - WakeOnLan (WOL) mit Homebridge
-
-
ich mache wol damit der PCs startet und dann gehe ich mit rdp oder TeamViewer auf meinen Desktop. Wenn ich fertig bin fahre ich den PCs einfach runter mit herunter fahren.
Nach dem cp Befehl zum nachsehen.
Der 2. Befehl sollte die selben Dateien anzeigen wie der 1. Befehl
Dann hat das kopieren geklappt.
Mit Samba und eine Befehlszeile kann man mit WOL den Pc starten und auch runterfahren. Dafür wird aber Samba benötigt. Ich habe jetzt ein anderes Wol Plugin, damit kann ich aber nur starten.
Wird nach der Umstellung die Homebridge automatisch als Root beim Reboot starten?
Wenn du alles gemacht hast, ja
1.Kopieren
2.Rechte setzen
3.Editieren
4.HomeBridge neu starten
Es geht nicht darum was du machst,
Alles wo sudo vorn an steht ist ein Befehl den dunkles Root ausführst.
Es geht darum wer quasi das Programm hombridge startet.
Bash
Alles anzeigen#!/bin/sh ### BEGIN INIT INFO # Provides: homebridge # Required-Start: $network $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start daemon at boot time for homebridge # Description: Enable service provided by daemon. ### END INIT INFO export PATH=$PATH:/usr/local/bin export NODE_PATH=$NODE_PATH:/usr/local/lib/node_modules PID=`pidof homebridge` case "$1" in start) if ps -p $PID > /dev/null 2>&1; then echo "Homebridge is already running" else su - pi -c "homebridge > /dev/null 2>&1 &" echo "Homebridge starting" $0 status fi ;; stop) if ! ps -p $PID > /dev/null 2>&1; then echo "Homebridge is not running" else kill $PID echo "Homebridge closed" fi ;; restart) if ! ps -p $PID > /dev/null 2>&1; then $0 start else $0 stop $0 start fi ;; status) if ps -p $PID > /dev/null 2>&1; then echo "Homebridge is running PID $PID" else echo "Homebridge is not running" fi ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 ;; esac exit 0Zeile 19 "pi" durch "root" ersetzen
Habe jetzt den kompletten oberen teil ersetzt wie du zum anfang geschrieben hast ersetzt. Ist das Falsch???
Bash
Alles anzeigen#!/bin/sh ### BEGIN INIT INFO # Provides: homebridge # Required-Start: $network $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start daemon at boot time for homebridge # Description: Enable service provided by daemon. ### END INIT INFO export PATH=$PATH:/usr/local/bin export NODE_PATH=$NODE_PATH:/usr/local/lib/node_modules dirusr="/root" user="root" PID=`pidof homebridge` case "$1" in start) if ps -p $PID > /dev/null 2>&1; then echo "Homebridge is already running" else # cd "$dirusr" # su - pi -c "homebridge > /dev/null 2>&1 &" su - root -c "homebridge >> /var/log/homebridge.log 2>> /var/log/homebridge.err &" echo "Homebridge starting" sleep 2 $0 status fi ;; stop) if ! ps -p $PID > /dev/null 2>&1; then echo "Homebridge is not running" else kill $PID echo "Homebridge closed" fi ;; restart) if ! ps -p $PID > /dev/null 2>&1; then $0 start else $0 stop $0 start fi ;; status) if ps -p $PID > /dev/null 2>&1; then echo "Homebridge is running PID $PID" else echo "Homebridge is not running" fi ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 ;;Code
Alles anzeigendirusr="/root" user="root" PID=`pidof homebridge` case "$1" in start) if ps -p $PID > /dev/null 2>&1; then echo "Homebridge is already running" else # cd "$dirusr" # su - pi -c "homebridge > /dev/null 2>&1 &" su - root -c "homebridge >> /var/log/homebridge.log 2>> /var/log/homebridge.err &" echo "Homebridge starting" sleep 2 $0 statusWobei ich Zeile 1.2.3 garnicht habe??
Code
Alles anzeigenpi@raspberrypi:~ $ sudo npm install -g homebridge-wol > [email protected] install /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket > node-gyp rebuild gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/7.6.0" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp" make: Entering directory '/usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/build' CXX(target) Release/obj.target/raw/src/raw.o ../src/raw.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE raw::CreateChecksum(Nan::NAN_METHOD_ARGS_TYPE)': ../src/raw.cc:70:43: warning: 'v8::Local<v8::Uint32> v8::Value::ToUint32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9035): Use maybe version [-Wdeprecated-declarations] uint32_t start_with = info[0]->ToUint32 ()->Value (); ^ ../src/raw.cc:92:31: warning: 'v8::Local<v8::Uint32> v8::Value::ToUint32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9035): Use maybe version [-Wdeprecated-declarations] offset = info[2]->ToUint32 ()->Value (); ^ ../src/raw.cc:104:48: warning: 'v8::Local<v8::Uint32> v8::Value::ToUint32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9035): Use maybe version [-Wdeprecated-declarations] unsigned int new_length = info[3]->ToUint32 ()->Value (); ^ ../src/raw.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE raw::Htonl(Nan::NAN_METHOD_ARGS_TYPE)': ../src/raw.cc:133:43: warning: 'v8::Local<v8::Uint32> v8::Value::ToUint32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9035): Use maybe version [-Wdeprecated-declarations] unsigned int number = info[0]->ToUint32 ()->Value (); ^ ../src/raw.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE raw::Htons(Nan::NAN_METHOD_ARGS_TYPE)': ../src/raw.cc:152:43: warning: 'v8::Local<v8::Uint32> v8::Value::ToUint32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9035): Use maybe version [-Wdeprecated-declarations] unsigned int number = info[0]->ToUint32 ()->Value (); ^ ../src/raw.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE raw::Ntohl(Nan::NAN_METHOD_ARGS_TYPE)': ../src/raw.cc:177:43: warning: 'v8::Local<v8::Uint32> v8::Value::ToUint32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9035): Use maybe version [-Wdeprecated-declarations] unsigned int number = info[0]->ToUint32 ()->Value (); ^ ../src/raw.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE raw::Ntohs(Nan::NAN_METHOD_ARGS_TYPE)': ../src/raw.cc:196:43: warning: 'v8::Local<v8::Uint32> v8::Value::ToUint32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9035): Use maybe version [-Wdeprecated-declarations] unsigned int number = info[0]->ToUint32 ()->Value (); ^ ../src/raw.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE raw::SocketWrap::GetOption(Nan::NAN_METHOD_ARGS_TYPE)': ../src/raw.cc:377:32: warning: 'v8::Local<v8::Int32> v8::Value::ToInt32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9041): Use maybe version [-Wdeprecated-declarations] int level = info[0]->ToInt32 ()->Value (); ^ ../src/raw.cc:378:33: warning: 'v8::Local<v8::Int32> v8::Value::ToInt32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9041): Use maybe version [-Wdeprecated-declarations] int option = info[1]->ToInt32 ()->Value (); ^ ../src/raw.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE raw::SocketWrap::New(Nan::NAN_METHOD_ARGS_TYPE)': ../src/raw.cc:461:42: warning: 'v8::Local<v8::Uint32> v8::Value::ToUint32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9035): Use maybe version [-Wdeprecated-declarations] socket->protocol_ = info[0]->ToUint32 ()->Value (); ^ ../src/raw.cc:469:27: warning: 'v8::Local<v8::Uint32> v8::Value::ToUint32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9035): Use maybe version [-Wdeprecated-declarations] if (info[1]->ToUint32 ()->Value () == 2) ^ ../src/raw.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE raw::SocketWrap::Send(Nan::NAN_METHOD_ARGS_TYPE)': ../src/raw.cc:651:30: warning: 'v8::Local<v8::Uint32> v8::Value::ToUint32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9035): Use maybe version [-Wdeprecated-declarations] offset = info[1]->ToUint32 ()->Value (); ^ ../src/raw.cc:652:30: warning: 'v8::Local<v8::Uint32> v8::Value::ToUint32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9035): Use maybe version [-Wdeprecated-declarations] length = info[2]->ToUint32 ()->Value (); ^ ../src/raw.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE raw::SocketWrap::SetOption(Nan::NAN_METHOD_ARGS_TYPE)': ../src/raw.cc:715:32: warning: 'v8::Local<v8::Int32> v8::Value::ToInt32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9041): Use maybe version [-Wdeprecated-declarations] int level = info[0]->ToInt32 ()->Value (); ^ ../src/raw.cc:716:33: warning: 'v8::Local<v8::Int32> v8::Value::ToInt32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9041): Use maybe version [-Wdeprecated-declarations] int option = info[1]->ToInt32 ()->Value (); ^ ../src/raw.cc:735:27: warning: 'v8::Local<v8::Int32> v8::Value::ToInt32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9041): Use maybe version [-Wdeprecated-declarations] len = info[3]->ToInt32 ()->Value (); ^ ../src/raw.cc:747:29: warning: 'v8::Local<v8::Uint32> v8::Value::ToUint32() const' is deprecated (declared at /usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/.node-gyp/7.6.0/include/node/v8.h:9035): Use maybe version [-Wdeprecated-declarations] ival = info[2]->ToUint32 ()->Value (); ^ SOLINK_MODULE(target) Release/obj.target/raw.node COPY Release/raw.node make: Leaving directory '/usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/build' /usr/local/lib ??? [email protected] ??? [email protected] ? ??? [email protected] ? ??? [email protected] ??? [email protected]Bekomme beim installieren diesen Fehler????
Ist meines Wissen normal, liegt am neuen nodejs
Ist ja trotzdem installiert.
Ich sehe nicht durch was du nun oben gemacht hast mit der Datei Bearbeitung.
Hatte doch geschrieben nur Zeile 19 von deinem Post 50 anpassen.
Also nur diese einfügen? su - root -c "homebridge >> /var/log/homebridge.log 2>> /var/log/homebridge.err &"
Also zusätzlich???