We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b8a1fe commit 497277aCopy full SHA for 497277a
main.go
@@ -21,6 +21,7 @@ var (
21
const (
22
FrameTypeData = 0x01
23
FrameTypeWindowSize = 0x02
24
+ FrameTypeShutdown = 0x03
25
)
26
27
func main() {
@@ -229,6 +230,13 @@ func handleConnection(conn net.Conn) {
229
230
pty.Setsize(ptty, &ws)
231
log.Printf("Resized PTY to %dx%d", width, height)
232
}
233
+ case FrameTypeShutdown:
234
+ log.Printf("Received shutdown command, executing reboot")
235
+ rebootCmd := exec.Command("reboot")
236
+ if err := rebootCmd.Run(); err != nil {
237
+ log.Printf("Error executing reboot: %v", err)
238
+ }
239
+ return
240
default:
241
log.Printf("Unknown frame type: %d", frameType)
242
0 commit comments