From 8fda39ba3124a6b48c39063a1a96a9d5ae0a02b0 Mon Sep 17 00:00:00 2001 From: EverythingWindows Date: Wed, 2 Nov 2022 18:09:01 +0700 Subject: [PATCH] Superuser test --- ShiftOS-TheRevival/MainForms/Strings.vb | 2 +- ShiftOS-TheRevival/MainForms/Terminal.vb | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ShiftOS-TheRevival/MainForms/Strings.vb b/ShiftOS-TheRevival/MainForms/Strings.vb index 6326be6..5a84488 100644 --- a/ShiftOS-TheRevival/MainForms/Strings.vb +++ b/ShiftOS-TheRevival/MainForms/Strings.vb @@ -26,7 +26,7 @@ '0 = OSVersion (default : dependant) ' 'OnceInfo Strings: - '0 = IsRoot? (0.1) (default : 0) + '0 = IsRoot? (0.1) (default : No) ' 'ComputerInfo Strings: '0 = Computer Name (0.1) (default : shiftos) diff --git a/ShiftOS-TheRevival/MainForms/Terminal.vb b/ShiftOS-TheRevival/MainForms/Terminal.vb index fdb6ef4..bc8262b 100644 --- a/ShiftOS-TheRevival/MainForms/Terminal.vb +++ b/ShiftOS-TheRevival/MainForms/Terminal.vb @@ -23,13 +23,13 @@ Public Sub PrintPrompt() If TextBox1.Text = Nothing Then - If Strings.OnceInfo(0) = "No" Then + If Strings.OnceInfo(0) = "Yes" Then TextBox1.Text = "root@" & Strings.ComputerInfo(0) & " #> " Else TextBox1.Text = Strings.ComputerInfo(1) & "@" & Strings.ComputerInfo(0) & " $> " End If Else - If Strings.OnceInfo(0) = "No" Then + If Strings.OnceInfo(0) = "Yes" Then TextBox1.Text = TextBox1.Text & Environment.NewLine & "root@" & Strings.ComputerInfo(0) & " #> " Else TextBox1.Text = TextBox1.Text & Environment.NewLine & Strings.ComputerInfo(1) & "@" & Strings.ComputerInfo(0) & " $> " @@ -38,7 +38,7 @@ End Sub Public Sub AssignPrompt() - If Strings.OnceInfo(0) = "No" Then + If Strings.OnceInfo(0) = "Yes" Then DefaultPrompt = "root@" & Strings.ComputerInfo(0) & " #> " Else DefaultPrompt = Strings.ComputerInfo(1) & "@" & Strings.ComputerInfo(0) & " $> " @@ -90,6 +90,7 @@ If Strings.AvailableFeature(0) = 1 Then TextBox1.Text = TextBox1.Text & Environment.NewLine & "MAN Shows a command, its corresponding action, and its example usage" End If + TextBox1.Text = TextBox1.Text & Environment.NewLine & "SU Runs terminal as super user" TextBox1.Text = TextBox1.Text & Environment.NewLine & "SHUTDOWN Terminate ShiftOS session" TextBox1.Text = TextBox1.Text & Environment.NewLine & "VER Printing current version of ShiftOS TheRevival" TextBox1.Text = TextBox1.Text & Environment.NewLine @@ -99,6 +100,15 @@ TextBox1.Text = TextBox1.Text & Environment.NewLine & "ShiftOS TheRevival version 0.1.1" AdvancedCommand = False BadCommand = False + Case "su" + If Strings.OnceInfo(0) = "Yes" Then + TextBox1.Text = TextBox1.Text & Environment.NewLine & "You already in root mode!" + Else + Strings.OnceInfo(0) = "Yes" + AssignPrompt() + End If + AdvancedCommand = False + BadCommand = False Case "shutdown", "shut down" ShiftOSMenu.Show() Close()