|
7 months ago | |
---|---|---|
cmd | 7 months ago | |
debian | 2 years ago | |
shell | 7 months ago | |
vendor | 1 year ago | |
.generated | 2 years ago | |
.gitignore | 7 months ago | |
.gitmodules | 2 years ago | |
LICENSE | 7 months ago | |
Makefile | 7 months ago | |
README.md | 7 months ago | |
VERSION | 7 months ago | |
go.mod | 7 months ago | |
go.sum | 7 months ago |
Skillet runs commands on shell and returns the output. It also supports control through UNIX sockets.
go get -U sour.is/x/skillet
create script directory
wget https://git.sour.is/attachments/67c5c7f8-3997-4796-b9b5-8fb8e2d8401e -O shell.tgz
tar xvJf shell.tgz
Skillet can be configured by command args, environment vars, or a config.toml file.
Usage:
skillet version
skillet [-v | -vv] connect [-u <UnixSocket>]
Options:
-v Log info to console.
-vv Log debug to console.
-c <ConfigDir>, --config=<ConfigDir> Set Config Directory.
-u <UnixSocket> Listen for commands on unix socket.
--tls Enable TLS
--tls-cert <cert> Use TLS Cert
--tls-key <key> Use TLS Key
Config:
The config file is read from the following locations:
- <ConfigDir>
- /etc/opt/sour.is/skillet/
- Working Directory
Environ variables
Variable | Notes |
---|---|
SKILLET_IRC_TLS |
enable TLS connection |
SKILLET_IRC_TLSCERT |
Use TLS Client Cert |
SKILLET_IRC_TLSKEY |
Use TLS Client Cert Key |
SKILLET_IRC_HOST |
Hostname and port to connect (ex. irc.host:6669) |
SKILLET_IRC_NICK |
Bot Nick to use |
SKILLET_IRC_CHAN |
Default channel to join (default: #skillet) |
SKILLET_IRC_PASS |
(optional) Password to authenticate with host |
SKILLET_IRC_OPER |
Nick of super user (default: none) |
SKILLET_IRC_UNIX |
(optional) Listen on socket (ex. /tmp/skillet.sock) |
SKILLET_IRC_CMDTIMEOUT |
(optional) Timeout for shell commands (default: 30 seconds) |
Config File
[irc]
# config for connecting to server here.
host = "localhost:6669"
chan = "#skillet"
nick = "skillet"
# pass = "secret password"
# oper = "somenick"
# unix = "/tmp/skillet.sock"
[irc.cmd]
run = "./run"
timeout = 30
[irc.opts]
# config to pass to shell here.
cd shell
skillet
writing to the socket can be done with netcat -U. By default the text you send will be noticed to the home chan a line at a time.
echo "hello world!" | nc -U /tmp/skillet.sock
Command modifiers can be used to make skillet do things. They are done by placing a +CMD TARGET
on a line by itsself.
where CMD is an IRC command. (PRIVMSG, NOTICE, JOIN, PART, INVITE, QUIT, RAW). These commands can be sent to the socket
or returned from scripts.
# Join a channel (or list of channels)
echo "+JOIN #channel #channel2" | nc -U /tmp/skillet.sock
# Part a channel (or list of channels)
echo "+PART #channel #channel2" | nc -U /tmp/skillet.sock
# Invite a user to a channel
echo "+INVITE somenick #channel" | nc -U /tmp/skillet.sock
# Private message a user.
echo "+PRIVMSG somenick\nhey this is a message!" | nc -U /tmp/skillet.sock
# Notice to a channel.
echo "+NOTICE #channel\nhey this is a message!" | nc -U /tmp/skillet.sock
# Quit and shutdown skillet.
echo "+QUIT quit message" | nc -U /tmp/skillet.sock
# Send RAW command to server
echo "+RAW KNOCK #channel" | nc -U /tmp/skillet.sock