- Home /
Question by
Nazirzadeh · Jul 27, 2021 at 10:56 AM ·
resetubuntu
Reboot Ubuntu
Hi, I need to reboot ubuntu from unity3d linux app.
Here is my code:
public void RebootLinuxPC()
{
System.Diagnostics.Process process = new
System.Diagnostics.Process();
process.StartInfo.FileName = "/usr/bin/sudo";
process.StartInfo.Arguments = "/sbin/shutdown -r now";
process.Start();
}
This code didn't work. Is there anyone who has tested reboot command on linux? Thanks.
Comment
Best Answer
Answer by Nazirzadeh · Jul 27, 2021 at 01:17 PM
Problem is solved. That was very simple.
public void RebootLinuxPC()
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "/sbin/reboot";
process.Start();
}
Your answer
Follow this Question
Related Questions
How to reset a variable when activated 1 Answer
Add seconds to timer countdown. 3 Answers
Comodo Firewall hangs Unity in fullscreen standalone mode 0 Answers
Problem when reset object 0 Answers
Problem with Reset and Custom Inspector 2 Answers