I have been trying to create a script to automate various processes, however, I can't figure out how to run certain parts of the script as root, and certain parts as my normal user.
I don't want to run the entire script as root, just the odd section.
I tried just using the su command, and then realised that I was now a totally different user and no longer executing my script.
I realise su isn't the best idea, however for testing purposes, its fine.
Is there a way to do this?
Am I nuts for even thinking about using su in a script?
My second idea was to start another shell as root, however I'm not entirely sure
how to do that from a script.
Cheers in advance.
Pentium 4 3.2Ghz Prescott 1MB Cache
Abit IC7 (875P Chipset)
3GB Corsair Dual Channel DDR
Nvidia GeForce 6600GT
500GB (SATA2-ReiserFS) Main drive
500GB (PATA-ReiserFS) Media drive
120GB (PATA-NTFS) Legacy data
OS: SimplyMEPIS 8