mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
29 lines
473 B
Swift
29 lines
473 B
Swift
//
|
|
// SSHState.swift
|
|
// ShhShell
|
|
//
|
|
// Created by neon443 on 25/06/2025.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
enum SSHState {
|
|
case idle
|
|
case connecting
|
|
case authorizing
|
|
case authorized
|
|
case shellOpen
|
|
}
|
|
|
|
func checkConnected(_ state: SSHState) -> Bool {
|
|
return !(state == .idle || state == .connecting)
|
|
}
|
|
|
|
func checkAuth(_ state: SSHState) -> Bool {
|
|
return state == .authorized || state == .shellOpen
|
|
}
|
|
|
|
func checkShell(_ state: SSHState) -> Bool {
|
|
return state == .shellOpen
|
|
}
|