I need your help with bash script that Im trying to build. To keep things simple I will make it short:The script starts running once its gets to run level 5 so i copied the script to /etc/rc.d/rc5.d/S99fixAnd it should look like this:init 3# Do some stuffinit 5rm rf /etc/rc.d/rc5.d/S99fixThe problem is that when I reboot the machine and it gets to runlevel 5 it starts the script by running the init 3 command but there it ends Im killing my own script before its time. the Do some stuff, init 5, rm -rf doesn't run.Is there a way I can do what I want to do and still switch between runlevels without killing my script while doing so?Just to add some details to this question...I'm using SLES 11.2i'm installing and configuring nvidia drivers so doing stuff in runlevel 3 is required.This research started as a way to do stuff to the X server while in runlevel 3 and bring it back to runlevel 5. I presume there is an option just to stop and start the xdm service. But now I've become interested to understand if switching between runlevel 3 and 5 is possible in bash script.
Switch between runlevel with init command in bash script  init 3 to init 5
linux;bash;init;runlevel