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
||enable TLS connection|
||Use TLS Client Cert|
||Use TLS Client Cert Key|
||Hostname and port to connect (ex. irc.host:6669)|
||Bot Nick to use|
||Default channel to join (default: #skillet)|
||(optional) Password to authenticate with host|
||Nick of super user (default: none)|
||(optional) Listen on socket (ex. /tmp/skillet.sock)|
||(optional) Timeout for shell commands (default: 30 seconds)|
[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