summaryrefslogtreecommitdiff
path: root/lib/chessh
diff options
context:
space:
mode:
authorSimponic <loganhunt@simponic.xyz>2022-12-19 01:37:10 -0700
committerSimponic <loganhunt@simponic.xyz>2022-12-19 01:39:10 -0700
commit9cdfb6eb9cd30c4e06a7d9fef53e519983827d81 (patch)
tree4622a1809df6a6424f1b5f9f10c72dd02f9fc176 /lib/chessh
downloadchessh-9cdfb6eb9cd30c4e06a7d9fef53e519983827d81.tar.gz
chessh-9cdfb6eb9cd30c4e06a7d9fef53e519983827d81.zip
Initial commit!
Diffstat (limited to 'lib/chessh')
-rw-r--r--lib/chessh/application.ex9
-rw-r--r--lib/chessh/shell.ex18
2 files changed, 27 insertions, 0 deletions
diff --git a/lib/chessh/application.ex b/lib/chessh/application.ex
new file mode 100644
index 0000000..c760532
--- /dev/null
+++ b/lib/chessh/application.ex
@@ -0,0 +1,9 @@
+defmodule Chessh.Application do
+ use Application
+
+ def start(_, _) do
+ children = [Chessh.Repo]
+ opts = [strategy: :one_for_one, name: Chessh.Supervisor]
+ Supervisor.start_link(children, opts)
+ end
+end
diff --git a/lib/chessh/shell.ex b/lib/chessh/shell.ex
new file mode 100644
index 0000000..f9f475d
--- /dev/null
+++ b/lib/chessh/shell.ex
@@ -0,0 +1,18 @@
+defmodule Chessh.Shell do
+ use Sshd.ShellHandler
+
+ def on_shell(_username, _public_key, _ip, _port) do
+ :ok =
+ IO.puts(
+ "Interactive example SSH shell - type exit ENTER to quit and it is running on #{inspect(self())}"
+ )
+ end
+
+ def on_connect(_username, _ip, _port, _method) do
+ Logger.debug("Connection established")
+ end
+
+ def on_disconnect(_username, _ip, _port) do
+ Logger.debug("Connection disestablished")
+ end
+end