HOME DOWNLOADS TOOLS HOW TO'S SOFTCAM.KEY FORUM LINKS
It is currently 19 Apr 2024, 07:38




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
 Enigma2 Shell Commands 
Author Message
Online
User avatar

Joined: 23 Jun 2009, 10:32
Posts: 132787
Location: On the barrel ...
Post Enigma2 Shell Commands
Acest topic provine de pe forumul OpenATV !!!

Comenzile Shell ale Linux sunt accesibile intr-o sesiune ... TelNet !

Comenzi Sistem

# Restart Receiver:
reboot

# Restart GUI:
init 4 && init 3

# system info:
uname -a

# Query disk space:
df -h

#Memory:
cat /proc/meminfo

# running processes:
ps ax
# ...or "TOP" processes (can be terminated with "q")...
Top

# Network:
ifconfig

# Network Connections:
netstat -tulips

# Mounts:
mount

# list scheduled tasks:
crontab -l

# Uptime of the box:
up time

Comenzi "Packge Management"

# update:
init 4
opkg update && opkg upgrade
reboot

# Query versions, e.g. secondstage:
opkg update && opkg list | grep seconds

# ...or search for the already installed ones via "list_installed"...
opkg list_installed *second*

# What is the update?
opkg update && opkg list-upgradable

# Install packages from /tmp...
opkg install /tmp/*.ipk

# ...or force overwrite...
opkg install --force-overwrite /tmp/*.ipk

# Install programs from the feed, e.g. curl and stat:
opkg update
opkg install curl stat

# Remove program:
opkg remove <PROGRAM>

# ...or uninstall incl. dependencies...
opkg remove --force-depends <PROGRAM>

# ...or automatically...
opkg remove --autoremove <PROGRAM>

Comenzi WebIF

# Query image version:
wget -O - -q http://127.0.0.1/web/deviceinfo | grep "\(<\|</\)e2imageversion" | tr -d '\n' | sed "s/.*<e2imageversion>\(.*\)<\/e2imageversion>.*/\\1\n/"

# Query PowerState:
wget -O - -q http://127.0.0.1/web/powerstate | grep "\(<\|</\)e2instandby" | tr -d '\n' | sed "s/.*<e2instandby>\(.*\)<\/e2instandby.*/\\1\n/g"

# Set PowerState (newstate=) -> 0 = Toggle Standby; 1 = deep standby; 2 = reboot; 3 = restart Enigma2; 4 = wakeup form standby; 5 = Standby:
wget -O - -q http://127.0.0.1/web/powerstate?newstate=0 | grep "\(<\|</\)e2instandby" | tr -d '\n' | sed "s/.*<e2instandby>\(.*\)<\/e2instandby.*/\\1\n/"

# query current channel:
wget -O - -q http://127.0.0.1/web/getcurrent | grep "\(<\|</\)e2servicename" | tr -d '\n' | sed "s/.*<e2servicename>\(.*\)<\/e2servicename.*/\\1\n/"
# ...Incl. SID needed to switch...
wget -O - -q http://127.0.0.1/web/getcurrent | grep -B 1 "\(<\|</\)e2servicename" | sed 's/<[^>]*>//g' | sed 's/^[ \t]*//' | sort -r

# Search channel, incl. SID, which is needed for switching, e.g. "the first hd"
wget -O - -q http://127.0.0.1/web/getallservices | grep -i -B 1 "the first hd" | sed 's/<[^>]*>//g' | sed 's/^[ \t]*//' | sort -r

# Switch channel, e.g. to "the first hd"
wget -O - -q "http://127.0.0.1/web/zap?sRef=1:0:19:283D:3FB:1:C00000:0:0:0:"

# Send Message
# urlencoder: http://url-encoder.de/
# type -> 0 = "Yes|No" (useless); 1 = popup; 2 = MessageBox
# timeout -> how long the popup should be displayed (seconds; popup only)
# text -> message (urlencoded!)
# the following example sends "Greetings from Schorsch :)"
wget -O - -q 'http://127.0.0.1/web/message?type=1&timeout=60&text=Gr%C3%BC%C3%9Fe%20von%20Schorsch%20%3A)'

Comenzi diverse

# SEEK ------------------------------------------------ ----
# Search, e.g. for "automounts" in "/etc"
find /etc -name *automounts*


#CRON ------------------------------------------------ -----
# Set the receiver to standby every day at 5:00 a.m. (in case you forget to switch it off):
# Cron must of course be installed
crontab -e
# use the "i" key to enter edit mode and then paste the following (the first line is optional)...

# START (do not copy this line)
# min hour day month dow command
0 5 * * * /usr/bin/wget -q -O - 'http://127.0.0.1/web/powerstate?newstate=5' >/dev/null 2>&1
# END (do not copy this line)

# ...then click "ESC" and ":wq" to save and check if the entry exists...
crontab -l

# ...possibly. then a cron restart is necessary...
/etc/init.d/busybox-cron restart


# Run custom script on boot ---------------------
# in this example I also run my "ddns_client" at startup
# create the following script (copy everything between START and END) and follow the INSTALL instructions...
# IMPORTANT is that each command ends with "&"!
# START (do not copy this line)
#!/bin/sh
# ################################################# #########
# INSTALL:
# copy this file to: /usr/script/user_boot.sh
# chmod this file: chmod 0755 /usr/script/user_boot.sh
# create a symlink: ln -s /usr/script/user_boot.sh /etc/rc3.d/S99user_boot.sh
#
# UNINSTALL:
# rm /etc/rc3.d/S99user_boot.sh
# ################################################# #########

[ -x /usr/script/ddns_client.sh ] && /usr/script/ddns_client.sh &

exit 0
# END (do not copy this line)

_________________
Ex computer guru !


25 Mar 2023, 10:55
Profile Send private message
Online
User avatar

Joined: 23 Jun 2009, 10:32
Posts: 132787
Location: On the barrel ...
Post Re: Enigma2 Shell Commands
Telnet Commands for Your Enigma2 Box

Update/Upgrade/Download/Install Commands

opkg update (short for Open PacKaGe Management) – this command will update
the image feeds located in /etc/opkg/ (to make sure just check the path to
your opkg folder) Basically, what the command does is to check and let your
image know that the updates are there ready to be installed.
opkg upgrade – this command updates the image and/or plugins that were
identified by the above opkg update command. When using these commands
it is recommended to first put the enigma2 into a sleeping mode so that any
changes that are made have less risk of becoming corrupted as this may
happen when being updated in a running state.
opkg list-upgradable – allows you to check what is available to update on the
image (same as opkg update)
opkg download – allows you to download plugins directly from the images own
feeds in a installable .ipk format to the /home/root/ directory of your receiver.
Example usage:

opkg download enigma2-plugin-extensions-backupsuite
opkg download enigma2-plugin-systemplugins-autobouquetsmaker

opkg install – allows you to install plugins directly from the image feeds.
Example usage:

opkg install enigma2-plugin-systemplugins-autobouquetsmaker
opkg install enigma2-plugin-extensions-backupsuite
opkg remove package – this command removes packages (replace “package”
with package name).

Now I will share some other commands that I use very often along with a
brief description of what the commands do. Most if not all commands work
the same across all images:

Init codes

init 1 – stops Enigma2 and network.
init 3 – wakes Enigma2 from a sleeping state / GUI restart.
init 4 – kill enigma / puts enigma into sleep mode allowing you to edit or
modify files that otherwise would corrupt or become damages if edited while live.
init 6 – full reboot.

Other Enigma2 Commands

grab -o -p /tmp/filename.png – very useful command, grabs the osd
screenshot of your box and saves it in /temp/. Replace “filename.png” with
the name you want to use for the screenshot.
grab -d -p /tmp/filename.png – the same except it grabs the channel too.
shutdown -r now – the same as the above init 6 command.
shutdown -h now – full shutdown.
lsusb – lists all attached USB devices.
df -h – checks memory and storage stats.
nmap -sp 192.168.1.0/24 – allows you to map your local network (change
the IP address for mapping your own network).
cat /proc/meminfo – memory info.
killall -9 enigma2 – If your box freezes for some reasons, this will restart
Enigma2 for you.

Standard Linux Telnet Commands list

top – this commands will give you current stats of your memory, cpu, program usage.
find – this command will find a file or folder within your dreambox directory structure.
rm – remove command will remove files normally followed by -rf for a
complete removal from the system.
df – will show you the file system and the file system setup.
free – this command shows you the memory usage on your dreambox.
date – shows you the time and date on your dreambox.
unzip – this command will unzip files to a location of your choice. IE (unzip -o
/tmp/Latest.zip /media/hdd/latest) that would take a file in the tmp folder
and unzip it into /media/hdd/latest.
tar – roughly is the same as unzip and zip but for tarball files.
gzip – for zipping and unzipping gz files.
cp – the copy command, this will copy a file from one location to another.
mkdir – this command will make a directory of your choice.
uname – usually followed by -a will tell you what operating system you are
using, very useful command for checking what box you are using and build
times etc!
ls – this is the list command will list the contents of a directory.
which – nice command to find the location of a program.
chmod/chown/adduser/deluser/ – these are all user and group management
commands… there are a few more but these are the obvious ones.

Advanced Commands

ipkg-build – this command will build you a plugin once you have wrote the
plugin in correctly written bash.
ipkg-unbuild -this command will unbuild a plugin see above (these two
commands may not work on all boxes – I am going to make separate post
about plugin building, so stay in touch).
dmesg – used with (dmesg | more) is a very powerful and first call diagnostic
tool in linux.
grep – put this in here as its probably the most used command in linux and
very powerful for searching files and listing information in order.
wget – by far my favorite command on linux platforms and so underrated, I
can do with this command things that people would not believe, however its
main use is for getting information/files/ from another location on the interne
or lan.
enigma2 – this is the base command for enigma2 boxes, only use this
command if you know what you are doing… a useful command for use is
(enigma –help-all)

Obviously this list is not exhaustive and there are many more commands
available for use with your enigma2 box. I’ll keep updating this post with new
commands and if you want to update this list as well or have something to
say just use comments section below. Thanks for reading and until next time!

_________________
Ex computer guru !


15 Jul 2023, 14:52
Profile Send private message
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.