webMAN-MOD icon indicating copy to clipboard operation
webMAN-MOD copied to clipboard

[HELP] Script

Open LuanTeles opened this issue 8 months ago • 19 comments

Aldo, here's my boot_init.txt that I’ve been using for years. It works for 99% of people, but occasionally, someone encounters an error. One part of the script checks if /dev_hdd0/vm/settings.xml exists. If it doesn’t, the script performs other actions, then writes the file and reboots.

However, on some rare systems, it doesn't complete and gets stuck forever in the notification i set.

https://github.com/user-attachments/assets/7dd57056-6ae2-4916-950e-8c0e610df698

Any tips?

boot_init.txt

boot_init_swap.txt

LuanTeles avatar Mar 28 '25 19:03 LuanTeles

Hello Luan, Thank you for your message. I looked briefly to your code and it looks fine. If it's working for most of your users, it could an external condition that is causing the infinite loop.

Anyway the script was designed to execute simple sequential tasks with some conditions. If your case, you're trying to execute more complex tasks that are better to be implemented in a plugin like xai_plugin or as custom code in webMAN MOD.

My suggestion are: 1- Try to identify the exact sequence of conditions that cause the loop. Then try to reproduce it in a different environment, to check if it's an issue with the script file or if it's a bug in the script engine.

2- Try to refactor the script in several scripts that perform sequential commands, avoiding the use of goto commands. FYI every time a goto is performed, the script is reloaded from the file.

this line is probably one of the cause of your bugs: fcopy /dev_hdd0/boot_init_swap.txt,/dev_hdd0/game/PS34KPROX/USRDIR/toolbox/patches/boot_plugins/hfw/boot_init.txt it's followed by a goto, which forces to reload script with the execution code replaced.

3- If possible, implement the script as custom code of webMAN or in a custom plugin.

aldostools avatar Mar 28 '25 20:03 aldostools

I got 4 people this week with the same issue. I formatted both of my systems due to the 4.92.2 error, and it created the .xml just fine, so I don't know what the issue could be.

But I still wonder what's really going on.

Now, my installer is creating the file with a .off extension, so I set my script to rename it to .xml. Hopefully, that will solve the issue.

LuanTeles avatar Jul 31 '25 22:07 LuanTeles

Aldo, I finally found someone with this issue who actually knows how to use FTP, and with the help of the debug command, I was able to track it down.

It turns out my script hangs in these consoles on every command that uses $USERID$. I’m using:

/xmb.ps3$xregistry(/setting/user/$USERID$/account/avatarurl)=/dev_flash/vsh/resource/explore/user/141.png
/xmb.ps3$xregistry(/setting/user/$USERID$/browser/cookieMode)=1
/xmb.ps3$xregistry(/setting/user/$USERID$/browser/dpi)=0
/xmb.ps3$xregistry(/setting/user/$USERID$/browser/exitConfirmation)=0
/xmb.ps3$xregistry(/setting/user/$USERID$/browser/fontSize)=0
/xmb.ps3$xregistry(/setting/user/$USERID$/browser/interlaceFilter)=1
/xmb.ps3$xregistry(/setting/user/$USERID$/browser/javascript)=1
/xmb.ps3$xregistry(/setting/user/$USERID$/browser/overscan)=1
/xmb.ps3$xregistry(/setting/user/$USERID$/input/keyLayoutType)=1
/xmb.ps3$xregistry(/setting/user/$USERID$/npaccount/autoSignInEnable)=0
/xmb.ps3$xregistry(/setting/user/$USERID$/theme/wallpaper)=0
/xmb.ps3$xregistry(/setting/user/$USERID$/wboard/enable)=0
/xmb.ps3$xregistry(/setting/user/defaultLoginUserId)=$USERID$

I tried removing them one by one, but it would always stop at the next line containing $USERID$. To test further, I moved one to the very end of the script, and sure enough, the script hung there.

The funny thing is that using IP-ADDRESS/$USERID$ returns the correct userID path (I thought webMAN wouldn’t detect it properly since the script itself isn’t getting the USERID). His user is 00000039

LuanTeles avatar Aug 10 '25 05:08 LuanTeles

The tag $USERID$ is unsupported on LITE EDITION. Are you using that plugin?

aldostools avatar Aug 10 '25 13:08 aldostools

The tag $USERID$ is unsupported on LITE EDITION. Are you using that plugin?

Nah, my installer installs the full version, and since his webMAN was able to use the command via a web browser, that confirms it’s the full one.

Image

Maybe it's a timing issue ??? (i don't think so because it has delays) but for most it works just fine.

I'm worried about it again, because about 7 people had this problem with the pro mod.

LuanTeles avatar Aug 12 '25 21:08 LuanTeles

One more, i'll try to increase the delays.

Image

LuanTeles avatar Aug 13 '25 17:08 LuanTeles

Multiple users are experiencing this issue. The commands that require a $USERID$ hang during execution.

I have tried adding wait commands before the call, but this has not solved the problem on the affected systems. As the welcome notification in the image shows, webMAN is correctly identifying the user, but the subsequent commands still fail to succeed.

Image

LuanTeles avatar Aug 26 '25 02:08 LuanTeles

this one hang with this (from log.txt)

if exist /dev_flash/vsh/resource/npsignin_plugin.lck /xmb.ps3$xregistry(/setting/user/$USERID$/npaccount/autoSignInEnable)=0 else if exist /dev_flash/vsh/resource/AAA/npsignin_plugin.rco

LuanTeles avatar Aug 26 '25 02:08 LuanTeles

Why are you writing everything in a single line? I don't have access to my PS3 to test at this moment, but it should look like this:

if exist /dev_flash/vsh/resource/npsignin_plugin.lck
  /xmb.ps3$xregistry(/setting/user/$USERID$/npaccount/autoSignInEnable)=0
else if exist /dev_flash/vsh/resource/AAA/npsignin_plugin.rco 

aldostools avatar Aug 26 '25 03:08 aldostools

Why are you writing everything in a single line? I don't have access to my PS3 to test at this moment, but it should look like this:

if exist /dev_flash/vsh/resource/npsignin_plugin.lck
  /xmb.ps3$xregistry(/setting/user/$USERID$/npaccount/autoSignInEnable)=0
else if exist /dev_flash/vsh/resource/AAA/npsignin_plugin.rco 
if exist /dev_flash/vsh/resource/npsignin_plugin.lck
/xmb.ps3$xregistry(/setting/user/$USERID$/npaccount/autoSignInEnable)=0
else if exist /dev_flash/vsh/resource/AAA/npsignin_plugin.rco

Looks like the github formated it lol, but it's right

Log.txt

Image

my boot_init.txt

Image

LuanTeles avatar Aug 26 '25 03:08 LuanTeles

The next command is: fcopy /dev_hdd0/boot_init_swap.txt,/dev_hdd0/game/PS34KPROX/USRDIR/toolbox/patches/boot_plugins/cfw/boot_init.txt

I'm looking at a potential problem. On my system where it works, the file has 0666 permission. On his system, the file is already in the folder, but its permission is 0644. Could this be the issue?

LuanTeles avatar Aug 26 '25 03:08 LuanTeles

This require extensive debugging. Currently I cannot dedicate much time to test this.

I think that it would be better if you implement these features directly in a plugin or modify webMAN MOD's code, instead of rely on the batch script.

The batch script is not intended to be a full programming language. It was added to make basic tasks.

aldostools avatar Aug 26 '25 03:08 aldostools

This require extensive debugging. Currently I cannot dedicate much time to test this.

I think that it would be better if you implement these features directly in a plugin or modify webMAN MOD's code, instead of rely on the batch script.

The batch script is not intended to be a full programming language. It was added to make basic tasks.

Yep, I know. I tried to add it to the XMBM+ team installer, but since it uses PSL1GHT, my attempt to adapt the code just froze the system

LuanTeles avatar Aug 26 '25 03:08 LuanTeles

I'm looking at a potential problem. On my system where it works, the file has 0666 permission. On his system, the file is already in the folder, but its permission is 0644. Could this be the issue?

It could be a possible cause. The file attributes usually is a common cause of problems when the code looks good.

aldostools avatar Aug 26 '25 03:08 aldostools

I'm looking at a potential problem. On my system where it works, the file has 0666 permission. On his system, the file is already in the folder, but its permission is 0644. Could this be the issue?

It could be a possible cause. The file attributes usually is a common cause of problems when the code looks good.

I'll make the script delete the file or chmod it before trying to overwrite it.

tomorrow I'll let you know how it goes

Thanks aldo

LuanTeles avatar Aug 26 '25 03:08 LuanTeles

One more question Aldo

IIRC, there is a chmod web command, but I can't find it anymore. What is it?

LuanTeles avatar Aug 26 '25 03:08 LuanTeles

/chmod.ps3<path>                   - change file permissions to 0777
/chmod.ps3<path>&mode=<mode>       - change file permissions to specific mode

/stat.ps3<path>                    - count files & folder size
/stat.ps3<path>&id=<title_id>      - link identical files in /hdd0/game using MD5
/stat.ps3<path>&id=<title_id>?fast - don't check MD5

aldostools avatar Aug 26 '25 03:08 aldostools

/chmod.ps3<path>                   - change file permissions to 0777
/chmod.ps3<path>&mode=<mode>       - change file permissions to specific mode

/stat.ps3<path>                    - count files & folder size
/stat.ps3<path>&id=<title_id>      - link identical files in /hdd0/game using MD5
/stat.ps3<path>&id=<title_id>?fast - don't check MD5

Thanks, it looks like it's missing from the web command list.

LuanTeles avatar Aug 26 '25 03:08 LuanTeles

yes it's missing... I'll add it later

aldostools avatar Aug 26 '25 03:08 aldostools