PDA

View Full Version : Priority Script: S4ProcLVL



massimo1167
29-03-2010, 09:22 PM
save this as a file without extension, example S4ProcLVL
it works for usb, cifs,nfs, etc.

Since the original script was posted in a topic dedicated to E2, I thought to open a new topic on the subject.

Because I have issues, I decided to change it using a field updated with every module change (/ DISK2/selene.conf).

This is the script (I have not done tests on optimization of priorities but only on the script):

#!/bin/bash
# PROCLVL Made By MalMen and modified by massimo1167
# Thanks for TypeR for his research....
start() {
echo "===> Starting user defined script S4ProcLVL"

echo "User script test" > /tmp/S4ProcLVL_IsRunning
}

stop() {
echo "===> Stopping user defined script S4ProcLVL"
rm -f /tmp/S4ProcLVL_IsRunning
}

restart() {
stop
start
}

start
sleep 10
until [ 1 -gt 10 ]; do
VAR1=`ps x|grep CRTVCore|wc -l`
VAR2=`ps x|grep SDecoderServer|wc -l`
VAR3=`cat /tmp/proclvl`
VAR4=`cat /DISK2/selene.conf|grep currnt_menu=|sed 's/currnt_menu=//'`
if [ "$VAR4" == "TV" ]; then
if [ "$VAR3" != "TV" ]; then
/MMP/usr/bin/snice -v SDecoderServer 10
/MMP/usr/bin/snice -v DStar 10
/MMP/usr/bin/snice -v CRTVCore -4
/MMP/usr/bin/snice -v CRTVSetup -1
/MMP/usr/bin/snice -v mbox_module -3
/MMP/usr/bin/snice -v emu_module -3
/MMP/usr/bin/snice -v telnetd 15
/MMP/usr/bin/snice -v vsftpd 15
/MMP/usr/bin/snice -v JIPC_Server 14
/MMP/usr/bin/snice -v cifsdnotifyd 15
/MMP/usr/bin/snice -v cifsoplockd 15
/MMP/usr/bin/snice -v xfslogd 4
/MMP/usr/bin/snice -v xfsdatad 4
/MMP/usr/bin/snice -v xfsbufd 4
/MMP/usr/bin/snice -v ir_control -2
echo TV > /tmp/proclvl
echo "New configuration for TV module"
echo "CRTVCore=$VAR1, SDecoderServer=$VAR2, last_menu=$VAR3, new_currnt_menu=$VAR4";
fi
elif [ "$VAR4" == "VIDEO" ]; then
if [ "$VAR3" != "VIDEO" ]; then
/MMP/usr/bin/snice -v SDecoderServer -19
/MMP/usr/bin/snice -v DStar 15
/MMP/usr/bin/snice -v CRTVCore 18
/MMP/usr/bin/snice -v CRTVSetup 18
/MMP/usr/bin/snice -v mbox_module 2
/MMP/usr/bin/snice -v emu_module 2
/MMP/usr/bin/snice -v telnetd 19
/MMP/usr/bin/snice -v vsftpd 19
/MMP/usr/bin/snice -v JIPC_Server 18
/MMP/usr/bin/snice -v cifsdnotifyd 19
/MMP/usr/bin/snice -v cifsoplockd 19
/MMP/usr/bin/snice -v xfslogd -15
/MMP/usr/bin/snice -v xfsdatad -15
/MMP/usr/bin/snice -v xfsbufd -15
/MMP/usr/bin/snice -v ir_control 19
echo VIDEO > /tmp/proclvl
echo "New configuration for VIDEO module"
echo "CRTVCore=$VAR1, SDecoderServer=$VAR2, last_menu=$VAR3, new_currnt_menu=$VAR4";
fi
elif [ "$VAR4" == "YOUTUBE" ]; then
if [ "$VAR3" != "YOUTUBE" ]; then
/MMP/usr/bin/snice -v SDecoderServer 4
/MMP/usr/bin/snice -v DStar 4
/MMP/usr/bin/snice -v CRTVCore 4
/MMP/usr/bin/snice -v CRTVSetup 4
/MMP/usr/bin/snice -v mbox_module 2
/MMP/usr/bin/snice -v emu_module 2
/MMP/usr/bin/snice -v telnetd 2
/MMP/usr/bin/snice -v vsftpd 2
/MMP/usr/bin/snice -v JIPC_Server 4
/MMP/usr/bin/snice -v cifsdnotifyd 4
/MMP/usr/bin/snice -v cifsoplockd 4
/MMP/usr/bin/snice -v xfslogd 4
/MMP/usr/bin/snice -v xfsdatad 4
/MMP/usr/bin/snice -v xfsbufd 4
/MMP/usr/bin/snice -v ir_control -4
/MMP/usr/bin/snice -v youtube_player -19
echo YOUTUBE > /tmp/proclvl
echo "New configuration for YOUTUBE module"
echo "CRTVCore=$VAR1, SDecoderServer=$VAR2, last_menu=$VAR3, new_currnt_menu=$VAR4";
fi
else
echo "Unknow module"
echo "CRTVCore=$VAR1, SDecoderServer=$VAR2, last_menu=$VAR3, new_currnt_menu=$VAR4";
fi
sleep 60;
done;
stop

rtificial
30-03-2010, 12:00 PM
Looks interesting. Now can we trigger this script to be activated by activity-change? Or do I misinterpret the script?

massimo1167
30-03-2010, 01:33 PM
Looks interesting. Now can we trigger this script to be activated by activity-change? Or do I misinterpret the script?
if you save the script in "/DISK2/etc/start.d", when azbox start, the script will run automatically and remain running.
Every 60 seconds will check the active menu defined in selene.conf and each time will find a new menu (beetwin YouTube, TV and movie) the script will redefine the modules priorities.

rsl123
30-03-2010, 07:01 PM
With the priority script copied or linked to the startup directory (/DISK2/etc/start.d/) my box couldn't upgrade firmware. It stopped while extraction the image with a black screen, no upgrade process, nothing.
After removing the file from startup the upgrade worked without problems.

buyukbang
31-03-2010, 05:38 AM
This happens to me for all looped scripts in start.d. So this is not a specific problem for this script. I think opensat firmware upgrade module should be fixed to kill all running scripts in start.d.


With the priority script copied or linked to the startup directory (/DISK2/etc/start.d/) my box couldn't upgrade firmware. It stopped while extraction the image with a black screen, no upgrade process, nothing.
After removing the file from startup the upgrade worked without problems.

hfmls
31-03-2010, 08:37 AM
yes,confirmed.

kebien
31-03-2010, 04:05 PM
I tested in older firmware 92371.
It works,to some extent, to change priorities well.
As it takes 60 seconds to check for the active module,you have to wait at least 60 seconds to see if the cpu usage lowers after you changed module.
I tested the modules definitions and are the same as in the script.
Now,there are some high bitrate feeds I want to test this on as to maybe increase the usb storage prio to solve the bad recordings.
Usb storage process only show at recording,maybe adding the prio value to the list might help some.
I assume greater value gives higher priority,correct?
We'll see

hfmls
31-03-2010, 04:20 PM
nop, negative values means high priority

denton
31-03-2010, 06:21 PM
1. Am I right in thinking we copy the code to Notepad and save as text with a .sh suffix?

2. Would somebody be so kind as to tell me what this does, exactly?

Thanks
Denton

hfmls
31-03-2010, 06:26 PM
no, remove .sh sufix, put it without any extension.

it gives priorities to mediacenter processes if u're using mediacenter.
gives priority to TV processes if you're in TV module.
etc

vlaya
31-03-2010, 08:06 PM
I copied the script in S4ProcLVL file without extension and uploaded it via Total Commander in /DISK2/etc/start.d folder. Changed the attributes to 755. Then I rebooted Azbox, nothing happens. Checked ps, no sign of S4ProcLVL. Then I tried to execute it manually, like this:

MMP[~]$ /DISK2/etc/start.d/S4ProcLVL
: bad interpreter: No such file or directory

Also I tried:

MMP[~]$ cd /DISK2/etc/start.d
MMP[start.d]$ ./S4ProcLVL
: bad interpreter: No such file or directory

What am I doing wrong?

rsl123
31-03-2010, 08:29 PM
that's probably because your file is formated for dos. Try to convert it to unix:

dos2unix /DISK2/etc/start.d/S4ProcLVL

vlaya
31-03-2010, 08:38 PM
Thank you, thank you, thank you :) Worked like a charm.

How come I'm the only one with this problem? How did you guys do it, I mean create a file and copy it to Az?

hfmls
31-03-2010, 08:39 PM
i use notpad++

vlaya
31-03-2010, 08:41 PM
Me too :) Maybe the problem is in Total Commander and FTP upload?

hitman222
31-03-2010, 09:11 PM
if you save the script in "/DISK2/etc/start.d", when azbox start, the script will run automatically and remain running.
Every 60 seconds will check the active menu defined in selene.conf and each time will find a new menu (beetwin YouTube, TV and movie) the script will redefine the modules priorities.
I leave it in the script too DISK2/etc/start.d, or simply just in (/ DISK2/selene.conf?
Thanks:respect-053:

massimo1167
31-03-2010, 09:17 PM
I leave it in the script too DISK2/etc/start.d, or simply just in (/ DISK2/selene.conf?
Thanks:respect-053:
create a new file in DISK2/etc/start.d, you can save this file as "S4ProcLVL" or another name doesn't matter.
instead /DISK2/selene.conf is a system file used for recognize wich module is active.

PsiDOC
01-04-2010, 07:58 AM
Thank you, thank you, thank you :) Worked like a charm.

How come I'm the only one with this problem? How did you guys do it, I mean create a file and copy it to Az?

It's a windows notepad thing. Widows uses both a CR (carriage return) and LF (linefeed) at the end of a line.
Unix just uses the CR. Hence unis scripts come out all wrong.
If you use a unix friendly editor like the freeware Jen's File Editor then all will be well.

Psi

PS. Google Jen's File Editor for the download.

Psi

hfmls
01-04-2010, 08:01 AM
guys u can use MAZ (like DCC for dreambox)
it's really nice, i'm beta testing version 3.0 ;)
it's the best one out there.

u can chose in FTP how u wanna edit, unix etc etc

denton
01-04-2010, 08:31 AM
Works for me - I pasted it into notepad, saved as text file, edited the file name (removed the ".txt") and uploaded using FlashXP.

Denton

buyukbang
10-04-2010, 03:23 PM
Made a small change in the above script for faster channel switch that was discussed here:

https://www.satpimps.co.uk/showthread.php?p=715122&posted=1#post715122



#!/bin/bash
# PROCLVL Made By MalMen and modified by massimo1167
# Thanks for TypeR for his research....
start() {
echo "===> Starting user defined script S4ProcLVL"

echo "User script test" > /tmp/S4ProcLVL_IsRunning
}

stop() {
echo "===> Stopping user defined script S4ProcLVL"
rm -f /tmp/S4ProcLVL_IsRunning
}

restart() {
stop
start
}

start
sleep 10
until [ 1 -gt 10 ]; do
VAR1=`ps x|grep CRTVCore|wc -l`
VAR2=`ps x|grep SDecoderServer|wc -l`
VAR3=`cat /tmp/proclvl`
VAR4=`cat /DISK2/selene.conf|grep currnt_menu=|sed 's/currnt_menu=//'`
if [ "$VAR4" == "TV" ]; then
if [ "$VAR3" != "TV" ]; then
/MMP/usr/bin/snice -v SDecoderServer 10
/MMP/usr/bin/snice -v DStar 10
/MMP/usr/bin/snice -v CRTVCore -5
/MMP/usr/bin/snice -v CRTVSetup -5
/MMP/usr/bin/snice -v mbox_module -3
/MMP/usr/bin/snice -v emu_module -3
/MMP/usr/bin/snice -v telnetd 15
/MMP/usr/bin/snice -v vsftpd 15
/MMP/usr/bin/snice -v JIPC_Server 14
/MMP/usr/bin/snice -v cifsdnotifyd 15
/MMP/usr/bin/snice -v cifsoplockd 15
/MMP/usr/bin/snice -v xfslogd 4
/MMP/usr/bin/snice -v xfsdatad 4
/MMP/usr/bin/snice -v xfsbufd 4
/MMP/usr/bin/snice -v ir_control -2
echo TV > /tmp/proclvl
echo "New configuration for TV module"
echo "CRTVCore=$VAR1, SDecoderServer=$VAR2, last_menu=$VAR3, new_currnt_menu=$VAR4";
fi
elif [ "$VAR4" == "VIDEO" ]; then
if [ "$VAR3" != "VIDEO" ]; then
/MMP/usr/bin/snice -v SDecoderServer -19
/MMP/usr/bin/snice -v DStar 15
/MMP/usr/bin/snice -v CRTVCore 18
/MMP/usr/bin/snice -v CRTVSetup 18
/MMP/usr/bin/snice -v mbox_module 2
/MMP/usr/bin/snice -v emu_module 2
/MMP/usr/bin/snice -v telnetd 19
/MMP/usr/bin/snice -v vsftpd 19
/MMP/usr/bin/snice -v JIPC_Server 18
/MMP/usr/bin/snice -v cifsdnotifyd 19
/MMP/usr/bin/snice -v cifsoplockd 19
/MMP/usr/bin/snice -v xfslogd -15
/MMP/usr/bin/snice -v xfsdatad -15
/MMP/usr/bin/snice -v xfsbufd -15
/MMP/usr/bin/snice -v ir_control 19
echo VIDEO > /tmp/proclvl
echo "New configuration for VIDEO module"
echo "CRTVCore=$VAR1, SDecoderServer=$VAR2, last_menu=$VAR3, new_currnt_menu=$VAR4";
fi
elif [ "$VAR4" == "YOUTUBE" ]; then
if [ "$VAR3" != "YOUTUBE" ]; then
/MMP/usr/bin/snice -v SDecoderServer 4
/MMP/usr/bin/snice -v DStar 4
/MMP/usr/bin/snice -v CRTVCore 4
/MMP/usr/bin/snice -v CRTVSetup 4
/MMP/usr/bin/snice -v mbox_module 2
/MMP/usr/bin/snice -v emu_module 2
/MMP/usr/bin/snice -v telnetd 2
/MMP/usr/bin/snice -v vsftpd 2
/MMP/usr/bin/snice -v JIPC_Server 4
/MMP/usr/bin/snice -v cifsdnotifyd 4
/MMP/usr/bin/snice -v cifsoplockd 4
/MMP/usr/bin/snice -v xfslogd 4
/MMP/usr/bin/snice -v xfsdatad 4
/MMP/usr/bin/snice -v xfsbufd 4
/MMP/usr/bin/snice -v ir_control -4
/MMP/usr/bin/snice -v youtube_player -19
echo YOUTUBE > /tmp/proclvl
echo "New configuration for YOUTUBE module"
echo "CRTVCore=$VAR1, SDecoderServer=$VAR2, last_menu=$VAR3, new_currnt_menu=$VAR4";
fi
else
echo "Unknow module"
echo "CRTVCore=$VAR1, SDecoderServer=$VAR2, last_menu=$VAR3, new_currnt_menu=$VAR4";
fi
sleep 60;
done;
stop

Enjama88
15-04-2010, 08:54 AM
I have question.This script S4ProcLVL is to have an extension .sh ?
Does it have to be a file without extensions
I tried with and without extension, and I do not see the list of processes S4ProcLVL.
Of course i gives 755 attributes

buyukbang
15-04-2010, 09:05 AM
No matter, it'll work with .sh or without it. Just an execute right is needed.

When you use tops command to see active processes you 'll see "sh" not script name since scripts are interpreted by sh.


I have question.This script S4ProcLVL is to have an extension .sh ?
Does it have to be a file without extensions
I tried with and without extension, and I do not see the list of processes S4ProcLVL.
Of course i gives 755 attributes

massimo1167
15-04-2010, 09:11 AM
I have question.This script S4ProcLVL is to have an extension .sh ?
Does it have to be a file without extensions
I tried with and without extension, and I do not see the list of processes S4ProcLVL.
Of course i gives 755 attributes

The extension is not needed, but You must put the script in the folder "/DISK2/etc/start.d"

You can verify if the script works editing the file /tmp/proclvl, when You change beetwen TV or MOVIE or YOUTUBE the content of the file change.

rtificial
15-04-2010, 12:30 PM
use ps -aux instead of top, to see all running processes.

Enjama88
15-04-2010, 08:02 PM
At the beginning I create notepad file and paste the content script S4ProcLVL.
Later safe file without extension and i name file S13ProcLVL
I put this script to Disk2/etc/start.d/ and gives atribute 755
Then i reebot azbox

I check in tmp/ and I did not find this file proclvl.
I'll show screen
http://i.imagehost.org/t/0979/bez_tytu_u_18.jpg (http://i.imagehost.org/view/0979/bez_tytu_u_18)

And my process list with ps aux command

AZBox[~]$ ps -aux
PID Uid VmSize Stat Command
1 root 404 S init
2 root SWN [ksoftirqd/0]
3 root SW< [events/0]
4 root SW< [khelper]
5 root SW< [kthread]
6 root SW< [kblockd/0]
9 root SW< [khubd]
59 root SW [pdflush]
60 root SW [pdflush]
62 root SW< [aio/0]
65 root SW< [xfslogd/0]
66 root SW< [xfsdatad/0]
67 root SW< [xfsbufd]
61 root SW [kswapd0]
63 root SW [cifsoplockd]
64 root SW [cifsdnotifyd]
650 root SW< [cqueue/0]
651 root SW< [kseriod]
692 root SW [mtdblockd]
782 root SW [kjournald]
788 root SW [kjournald]
791 root SW [kjournald]
793 root SW [kjournald]
815 root 184 S udh*** -n -p /var/run/udh***.eth0.pid -i eth0
827 root 376 S /sbin/getty -L ttyS0 115200
843 root 744 S /MMP/usr/sbin/sshd
845 root 388 S /MMP/usr/sbin/vsftpd /MMP/etc/vsftpd.conf
852 root 276 S telnetd
871 root DW [scard]
886 root SW [kcdfsd]
901 root 820 S /MMP/usr/bin/JIPC_Server
903 root 820 S /MMP/usr/bin/JIPC_Server
904 root 820 S /MMP/usr/bin/JIPC_Server
905 root 820 S /MMP/usr/bin/JIPC_Server
931 root 12856 S /MMP/usr/bin/SDecoderServer
936 root 824 S /MMP/usr/bin/ir_control -td210
937 root 2244 S /MMP/usr/bin/file_control
938 root 19588 S /MMP/usr/bin/CRTVCore
939 root 784 S /MMP/usr/bin/CRTVSetup
943 root 2244 S /MMP/usr/bin/file_control
944 root 2244 S /MMP/usr/bin/file_control
945 root 2244 S /MMP/usr/bin/file_control
946 root 2244 S /MMP/usr/bin/file_control
955 root 19588 S /MMP/usr/bin/CRTVCore
956 root 19588 S /MMP/usr/bin/CRTVCore
981 root 19588 S /MMP/usr/bin/CRTVCore
982 root 19588 S /MMP/usr/bin/CRTVCore
983 root 19588 S /MMP/usr/bin/CRTVCore
984 root 19588 S /MMP/usr/bin/CRTVCore
985 root 19588 S /MMP/usr/bin/CRTVCore
986 root 19588 S /MMP/usr/bin/CRTVCore
987 root 19588 S /MMP/usr/bin/CRTVCore
990 root 24472 S < /MMP/usr/bin/DStar
997 root 12856 S /MMP/usr/bin/SDecoderServer
998 root 12856 S /MMP/usr/bin/SDecoderServer
999 root 12856 S /MMP/usr/bin/SDecoderServer
1240 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1242 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1243 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1244 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1247 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1248 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1249 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1250 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1251 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1252 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1253 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1254 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1255 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1256 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1257 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1258 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1259 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1260 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1261 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1262 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1263 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1264 root 4772 S /EMU/OpenXCAS/MultiCAS/emu_module
1366 root 19588 S /MMP/usr/bin/CRTVCore
1367 root 19588 S /MMP/usr/bin/CRTVCore
1368 root 19588 S /MMP/usr/bin/CRTVCore
1376 root 1124 S -sh
1381 nobody 512 S /MMP/usr/sbin/vsftpd /MMP/etc/vsftpd.conf
1383 root 564 S /MMP/usr/sbin/vsftpd /MMP/etc/vsftpd.conf
1385 root 400 R ps -aux

I'm using Multicas with cccam client.Does this mean that the script does not work for me?

Smudger
15-04-2010, 08:18 PM
your script maybe currupt because of notepad. try the command dos2unix the file name.

Enjama88
15-04-2010, 09:31 PM
I found online dos2unix

http://www.dos2unix.org/
Just convert the file without extension S4ProcLVL on this site?
It should work after that?

Ok
I conversion file on this site and worked :)
Many thanks guys.

buyukbang
18-04-2010, 10:11 PM
After deciding MGCamd works much better then Multicas do for my CCCam server (Multicas is slower and cannot open some channels that MGCamd opens), I made another minor change in the above script to handle MGCamd. Now the script supports MGCamd, Multicas and Mbox.




#!/bin/bash
# PROCLVL Made By MalMen and modified by massimo1167 & BuyukBang
# Thanks for TypeR for his research....
start() {
echo "===> Starting user defined script S4ProcLVL"

echo "User script test" > /tmp/S4ProcLVL_IsRunning
}

stop() {
echo "===> Stopping user defined script S4ProcLVL"
rm -f /tmp/S4ProcLVL_IsRunning
}

restart() {
stop
start
}

start
sleep 10
until [ 1 -gt 10 ]; do
VAR1=`ps x|grep CRTVCore|wc -l`
VAR2=`ps x|grep SDecoderServer|wc -l`
VAR3=`cat /tmp/proclvl`
VAR4=`cat /DISK2/selene.conf|grep currnt_menu=|sed 's/currnt_menu=//'`
if [ "$VAR4" == "TV" ]; then
if [ "$VAR3" != "TV" ]; then
/MMP/usr/bin/snice -v SDecoderServer 10
/MMP/usr/bin/snice -v DStar 10
/MMP/usr/bin/snice -v CRTVCore -5
/MMP/usr/bin/snice -v CRTVSetup -5
/MMP/usr/bin/snice -v emu_module -3
/MMP/usr/bin/snice -v mgcamd -3
/MMP/usr/bin/snice -v mbox_module -3
/MMP/usr/bin/snice -v telnetd 15
/MMP/usr/bin/snice -v vsftpd 15
/MMP/usr/bin/snice -v JIPC_Server 14
/MMP/usr/bin/snice -v cifsdnotifyd 15
/MMP/usr/bin/snice -v cifsoplockd 15
/MMP/usr/bin/snice -v xfslogd 4
/MMP/usr/bin/snice -v xfsdatad 4
/MMP/usr/bin/snice -v xfsbufd 4
/MMP/usr/bin/snice -v ir_control -2
echo TV > /tmp/proclvl
echo "New configuration for TV module"
echo "CRTVCore=$VAR1, SDecoderServer=$VAR2, last_menu=$VAR3, new_currnt_menu=$VAR4";
fi
elif [ "$VAR4" == "VIDEO" ]; then
if [ "$VAR3" != "VIDEO" ]; then
/MMP/usr/bin/snice -v SDecoderServer -19
/MMP/usr/bin/snice -v DStar 15
/MMP/usr/bin/snice -v CRTVCore 18
/MMP/usr/bin/snice -v CRTVSetup 18
/MMP/usr/bin/snice -v emu_module 2
/MMP/usr/bin/snice -v mgcamd 2
/MMP/usr/bin/snice -v mbox_module 2
/MMP/usr/bin/snice -v telnetd 19
/MMP/usr/bin/snice -v vsftpd 19
/MMP/usr/bin/snice -v JIPC_Server 18
/MMP/usr/bin/snice -v cifsdnotifyd 19
/MMP/usr/bin/snice -v cifsoplockd 19
/MMP/usr/bin/snice -v xfslogd -15
/MMP/usr/bin/snice -v xfsdatad -15
/MMP/usr/bin/snice -v xfsbufd -15
/MMP/usr/bin/snice -v ir_control 19
echo VIDEO > /tmp/proclvl
echo "New configuration for VIDEO module"
echo "CRTVCore=$VAR1, SDecoderServer=$VAR2, last_menu=$VAR3, new_currnt_menu=$VAR4";
fi
elif [ "$VAR4" == "YOUTUBE" ]; then
if [ "$VAR3" != "YOUTUBE" ]; then
/MMP/usr/bin/snice -v SDecoderServer 4
/MMP/usr/bin/snice -v DStar 4
/MMP/usr/bin/snice -v CRTVCore 4
/MMP/usr/bin/snice -v CRTVSetup 4
/MMP/usr/bin/snice -v emu_module 2
/MMP/usr/bin/snice -v mgcamd 2
/MMP/usr/bin/snice -v mbox_module 2
/MMP/usr/bin/snice -v telnetd 2
/MMP/usr/bin/snice -v vsftpd 2
/MMP/usr/bin/snice -v JIPC_Server 4
/MMP/usr/bin/snice -v cifsdnotifyd 4
/MMP/usr/bin/snice -v cifsoplockd 4
/MMP/usr/bin/snice -v xfslogd 4
/MMP/usr/bin/snice -v xfsdatad 4
/MMP/usr/bin/snice -v xfsbufd 4
/MMP/usr/bin/snice -v ir_control -4
/MMP/usr/bin/snice -v youtube_player -19
echo YOUTUBE > /tmp/proclvl
echo "New configuration for YOUTUBE module"
echo "CRTVCore=$VAR1, SDecoderServer=$VAR2, last_menu=$VAR3, new_currnt_menu=$VAR4";
fi
else
echo "Unknow module"
echo "CRTVCore=$VAR1, SDecoderServer=$VAR2, last_menu=$VAR3, new_currnt_menu=$VAR4";
fi
sleep 60;
done;
stop