Skip to content

Commit

Permalink
Added Reboot button
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioFPVdev authored and MarioFPVdev committed Mar 20, 2024
1 parent 7c90b5d commit 160bd3f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
19 changes: 16 additions & 3 deletions Configurator.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 21 additions & 1 deletion Configurator.vb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Public Class Configurator
MsgBox("File " + wfbconf + " not found!")
Return
End If

Dim majestic = "majestic.yaml"
If Not System.IO.File.Exists(majestic) Then
MsgBox("File " + majestic + " not found!")
Expand Down Expand Up @@ -494,4 +494,24 @@ Public Class Configurator
Return System.Text.RegularExpressions.Regex.IsMatch(ipAddress,
"^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$")
End Function

Private Sub btnReboot_Click(sender As Object, e As EventArgs) Handles btnReboot.Click
Dim extern = "extern.bat"
If Not System.IO.File.Exists(extern) Then
MsgBox("File " + extern + " not found!")
Return
End If

If IsValidIP(txtIP.Text) Then
With New Process()
.StartInfo.UseShellExecute = False
.StartInfo.FileName = extern
.StartInfo.Arguments = "rb " + String.Format("{0}", txtIP.Text)
.StartInfo.RedirectStandardOutput = False
.Start()
End With
Else
MsgBox("Please enter a valid IP address")
End If
End Sub
End Class
4 changes: 4 additions & 0 deletions Extern.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ if "%1" == "ul" (
plink -ssh root@%2 -pw %pw% dos2unix /etc/wfb.conf /etc/majestic.yaml
)

if "%1" == "rb" (
plink -ssh root@%2 -pw %pw% reboot
)

:end
echo.
pause

0 comments on commit 160bd3f

Please sign in to comment.