DreamOS terminal utils

    Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

    • DreamOS terminal utils

      Ich habe mir für OE2.5 einige scripte geschrieben die das Arbeiten im Terminal etwas vereinfachen (Im Grunde sind das alles nur front-ends) und habe mir überlegt ob ich dafür ein Paket machen soll.
      Es gibt zwar auch hübsche aliases, aber die sind nicht in jedem Image gleich, deshalb auch die Überlegung, dass die tools in jedem Image installierbar sein sollen


      Aber bevor ich mir die Arbeit mache und alles sauber scripte zwei Fragen:

      Besteht überhaupt Interesse dafür? Das "Arbeiten" im Terminal der Box wird ja immer unbeliebter ;)
      Welche Funktionen, Infos oder Steuerungsmöglichkeiten im Terminal wären (noch) interessant?




      Hier mal ein paar Beispiele:

      das pwctl is u.a. deshalb entstanden, weil ich mir hin und wieder bei e2 restart über das Terminal Aufnahmen geschrottet habe, weil systemctl restart enigma2.service ohne Rückfrage brutal neu startet :D
      aber das Grundkonzept schleppe ich nun schon seit OE1.6 mit ...

      pwctl (power control script for Enigma2 - DreamOS OE2.5/OE2.6) german and english help available

      Quellcode

      1. root@dm900:~# pwctl -h
      2. pwctl: power control script for Enigma2: (OE2.2), DreamOS/OE2.5
      3. Usage: pwctl {-p|-t|-i|-w|-r|-s|-b|-c|-h|-V|-R|-S|-B|-J|-D|-L|-LL}
      4. -p, --powerstate show powerstate
      5. -t, --toggle toggle idle on/off
      6. -i, --idle idle mode (old: standby)
      7. -w, --wakeup wake up from idle mode
      8. -r, --e2restart restart enigma2
      9. checks timers and current recordings *)
      10. -s, --standby standby (old: deepstandby)
      11. turn off the device
      12. checks timers and current recordings *)
      13. -b, --reboot reboot device
      14. checks timers and current recordings *)
      15. -c, --check-recording check current recordings and pending
      16. timers within the next 7 minutes
      17. -V, --version information about this version
      18. -h, --help show this help
      19. *) if there are current recordings or
      20. pending timers within the next
      21. 7 minutes the action have to be confirmed
      22. to prevent defective recordings
      23. if Enigma2 or the Webinterface does not respond maybe some
      24. usefull commands:
      25. -R, --e2Restart (hard Reset) kills Enigma2 and restarts
      26. it again if possible (no check if there
      27. are current recordings or pending timers)
      28. -S, --Standby same as 'shutdown -h now' (no check if there
      29. are current recordings or pending timers)
      30. -B, --reBoot same as 'shutdown -r now' (no check if there
      31. are current recordings or pending timers)
      32. -J, --e2Journal same as 'journalctl -r -u enigma2'
      33. show the latest Enigma2 events (latest
      34. events on top) - terminate with [Q]
      35. -D, --Debug same as 'journalctl -f -u enigma2'
      36. enigma2 livelog for debugging
      37. terminate with [Ctrl]+[C]
      38. -L, --Logging the same as the options -D, --Debug
      39. enigma2 livelog to stdout and into logfile:
      40. /tmp/enigma2_YYYYMMDD_HHMMSS.log
      41. terminate with [Ctrl]+[C]
      42. -LL, --last-log show last logfile
      43. root@dm900:~#
      44. root@dm900:~# pwctl -c
      45. 0 recording(s) at the moment
      46. no pendig timer within the next 7 minutes
      47. root@dm900:~#
      48. root@dm900:~# pwctl -r
      49. 0 recording(s) at the moment
      50. a pending timer will start in 0 minute(s) and 51 second(s)
      51. on So, 8. Mär. 2020 at 10:38:00
      52. restart enigma2 anyway? (y/n)
      53. no
      54. restart enigma2 cancelled
      55. root@dm900:~#
      56. root@dm900:~# pwctl --toggle
      57. toggle powerstate dm900
      58. dm900 is in idle mode now
      59. root@dm900:~# pwctl -t
      60. toggle powerstate dm900
      61. dm900 is active now
      62. root@dm900:~#
      Alles anzeigen




      cputemp

      Quellcode

      1. root@dm900:~# cputemp
      2. CPU temperature: 60.9°C
      3. root@dm900:~#




      hddtemp

      Quellcode

      1. root@dm900:~# hddtemp
      2. /dev/sda (ST2000LM015-2E8174): 37°C
      3. /dev/sdb: USB device, smartctl not supported
      4. root@dm900:~#




      currentservice-png (get picon name for current service)

      Quellcode

      1. root@dm900:~# currentservice-png
      2. Service Reference: 1:0:19:132F:3EF:1:C00000:0:0:0
      3. picon name: 1_0_19_132F_3EF_1_C00000_0_0_0.png
      4. root@dm900:~#




      project name dbsds (dreambox storage device scanner)

      Quellcode

      1. root@dm900:~# dbsds -h
      2. dbsds - dreambox storage device scanner
      3. -d, --show-all show all devices
      4. -a, --show-ata show all ATA devices
      5. -u, --show-usb show all USB devices
      6. -s, --show-mmc show all MMC/SD devices
      7. -p, --show-partitions show all partitions
      8. -m, --show-mounts show all mounted partions
      9. -i, --device-info show device infos
      10. -V, --version version info
      11. -L, --lisence lisence info
      12. -h, --help show this help
      13. root@dm900:~#
      14. root@dm900:~# dbsds -d
      15. /dev/mmcblk1: SD/MMC
      16. Model: SD SC16G
      17. Disk: 15,9GB
      18. /dev/sda: SATA
      19. Model: ATA ST2000LM015-2E81
      20. Disk: 2000GB
      21. root@dm900:~#
      22. root@dm900:~# dbsds -p
      23. /dev/mmcblk1: SD/MMC
      24. Model: SD SC16G
      25. Disk: 15,9GB
      26. Partition Table: msdos
      27. Number Start End Size Type File system Flags
      28. 1 1049kB 15,9GB 15,9GB primary ext4
      29. /dev/sda: SATA
      30. Model: ATA ST2000LM015-2E81
      31. Disk: 2000GB
      32. Partition Table: gpt
      33. Number Start End Size File system Name Flags
      34. 1 1049kB 1999GB 1999GB ext4 dreambox-storage
      35. 2 1999GB 2000GB 1073MB linux-swap(v1) dreambox-swap
      36. root@dm900:~#
      37. root@dm900:~# dbsds -i
      38. /dev/mmcblk1: SD/MMC
      39. Model: SD SC16G
      40. Disk: 15,9GB
      41. /dev/mmcblk1p1: LABEL="sd-card" UUID="e6e1f2b7-0e33-41e9-9be0-75e88ffa5623" TYPE="ext4"
      42. /dev/mmcblk1: PTTYPE="dos"
      43. /dev/sda: SATA
      44. Model: ATA ST2000LM015-2E81
      45. Disk: 2000GB
      46. /dev/sda1: LABEL="dreambox-storage" UUID="de954d30-ec21-4cc7-a60b-f9590177e7d8" TYPE="ext4" PARTLABEL="dreambox-storage" PARTUUID="894710b7-115b-48d3-9d2e-2139d7ead6dd"
      47. /dev/sda2: UUID="483a8166-7065-4a34-92d0-0c912a9b4fd2" TYPE="swap" PARTLABEL="dreambox-swap" PARTUUID="f6fc5ae3-02df-41d2-b10b-c97e624da7f3"
      48. root@dm900:~#
      49. root@dm900:~# dbsds -m
      50. /dev/mmcblk1: SD/MMC
      51. Model: SD SC16G
      52. Disk: 15,9GB
      53. /dev/mmcblk1p1 mounted to
      54. /media/sd
      55. /usr/local
      56. /picons
      57. /usr/share/enigma2/MetrixStyleHD-FBT
      58. /usr/script
      59. /usr/keys
      60. /dev/sda: SATA
      61. Model: ATA ST2000LM015-2E81
      62. Disk: 2000GB
      63. /dev/sda1 mounted to /media/hdd
      64. /dev/sda2 mounted to
      65. root@dm900:~#
      Alles anzeigen




      camdctrl (newnigma2 only!)

      Quellcode

      1. root@dm900:~# camdctrl
      2. USAGE: {start|stop|restart|current|currentscript|status|help}
      3. root@dm900:~#
      4. root@dm900:~# camdctrl status
      5. current emu: OScam modern #1540 -> running
      6. current emu start/stop script: /usr/script/OScam_1540_modern.emu
      7. current emu binary: /usr/local/bin/OScam_1540
      8. root@dm900:~#
      9. root@dm900:~# camdctrl currentscript
      10. /usr/script/OScam_1540_modern.emu
      11. root@dm900:~# camdctrl restart
      12. [SCRIPT] stop: OScam modern #1540
      13. [SCRIPT] start: OScam modern #1540
      14. root@dm900:~#
      Alles anzeigen


      Gruß Fred

      Die Dreambox ist tot, es lebe die Dreambox

      ¯\_(ツ)_/¯

      Quellcode

      1. root@dm920:~$ mount | grep "/ "
      2. /dev/mmcblk1p1 on / type ext4 (rw,relatime,data=ordered)
      3. root@dm920:~$

      Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von Fred Bogus Trumper ()

    • Hallo Fred,

      das arbeiten mit dem Terminal ist manchmal deutlich einfacher, als mit der Fernbedienung rumzuzappen.
      Daher sammle ich durch lesen in den Threads manche Befehle auf und Speicher die in dem Tool Royal TSX ab, um diese dann später zu nutzen.

      Also kurz gesagt, ich hätte Interesse.

      VG, rako123
      rako123
    • Hallo Fred,
      ich mag auch manche Arbeit durch Terminal zu machen, deshalb gute Arbeit. :)

      Habe versucht via Telnet die CPU Temperatur auslesen mit deiner Befehl, aber leider kein Erfolg, unten ist was ich bekommen habe.

      - DM920RC20
      - Image: DreamOS (OE 2.5)

      Kann man die CPU Temperatur via Telnet auslesen und mit welchen Befehl?

      Quellcode

      1. dm920 login: root
      2. root@dm920:~# cputemp
      3. -bash: cputemp: command not found
      4. root@dm920:~#
      SMR-1224 (EL)
      VBOX2 / VBOX3 +5V Positioner
      GIBERTINI OP 150S - C/Ku/Ku Circular
      TITANIUM ASC-1 DiSEqC Positioner - (Polarity & Skew Control)
    • touch /usr/script/cputemp.sh

      /usr/script/cputemp.sh

      Shell-Script

      1. #!/bin/bash
      2. # by Fred Bogus Trumper 2019
      3. model=$(cat /proc/stb/info/model)
      4. case $model in
      5. dm900|dm920)
      6. echo "CPU temperature: $(awk 'BEGIN {printf("%.1f\°C\n","'"$(cat /sys/class/thermal/thermal_zone0/temp 2>/dev/null)"'"/1000) }')"
      7. ;;
      8. *)
      9. echo -e "$model: CPU temperature not supported, no sensor found"
      10. ;;
      11. esac
      12. exit 0
      Alles anzeigen


      chmod 755 /usr/script/cputemp.sh

      aufrufen mit
      /usr/script/cputemp.sh

      Wobei im newnigma2 auch cputemp.sh reicht, weil /usr/script in der PATH Umgebungsvarible enthalten ist


      alternativ (für andere Images) einen alias erstellen
      echo "alias cputemp='/usr/script/cputemp.sh'" > /etc/profile.d/cputemp_alias.sh
      . /etc/profile.d/cputemp_alias.sh

      Quellcode

      1. root@dm900:~# cputemp
      2. CPU temperature: 58.4°C
      3. root@dm900:~#
      Gruß Fred

      Die Dreambox ist tot, es lebe die Dreambox

      ¯\_(ツ)_/¯

      Quellcode

      1. root@dm920:~$ mount | grep "/ "
      2. /dev/mmcblk1p1 on / type ext4 (rw,relatime,data=ordered)
      3. root@dm920:~$

      Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von Fred Bogus Trumper ()

    • CK71 schrieb:

      Kann man die CPU Temperatur via Telnet auslesen und mit welchen Befehl?

      Quellcode

      1. dm920 login: root
      2. root@dm920:~# cputemp
      3. -bash: cputemp: command not found
      4. root@dm920:~#

      Spoiler anzeigen
      Temperatur
      CPU Temperatur auslesen
      ---------------------------------------------------------------------------------------
      root@dm920:~$ cat /sys/class/thermal/thermal_zone0/temp
      43816
      root@dm920:~$


      Lüfter Kit DM920/DM900 :D :D :D

      Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von wernerr ()

    • es geht auch ohne das sript, aber wer merkt sich das schon :D


      Quellcode

      1. root@dm900:~# echo "CPU temperature: $(awk 'BEGIN {printf("%.1f\°C\n","'"$(cat /sys/class/thermal/thermal_zone0/temp 2>/dev/null)"'"/1000) }')"
      2. CPU temperature: 57.5°C
      3. root@dm900:~#


      Falls jemand einen Fahrenheit Umrechner benötigt

      Quellcode

      1. root@dm900:~# echo "CPU temperature: $(awk 'BEGIN {printf("%.1f\°F\n","'"$(cat /sys/class/thermal/thermal_zone0/temp 2>/dev/null)"'"/1000*1.8+32) }')"
      2. CPU temperature: 134.5°F
      3. root@dm900:~#
      Gruß Fred

      Die Dreambox ist tot, es lebe die Dreambox

      ¯\_(ツ)_/¯

      Quellcode

      1. root@dm920:~$ mount | grep "/ "
      2. /dev/mmcblk1p1 on / type ext4 (rw,relatime,data=ordered)
      3. root@dm920:~$

      Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von Fred Bogus Trumper ()

    • Habe Werners Befehl mit Telnet ausprobiert und er Funktioniert, Vielen Dank. :)

      Die Zahl 39920 ist 39,92°C Denke ich.

      Quellcode

      1. opendreambox 2.5.0 dm920
      2. dm920 login: root
      3. root@dm920:~# cat /sys/class/thermal/thermal_zone0/temp
      4. 39920
      5. root@dm920:~#
      SMR-1224 (EL)
      VBOX2 / VBOX3 +5V Positioner
      GIBERTINI OP 150S - C/Ku/Ku Circular
      TITANIUM ASC-1 DiSEqC Positioner - (Polarity & Skew Control)