faut que je trouve des blagues de cul, rapport avec le nom du projet, m'voyez ?
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import socket
|
||||
|
||||
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
sockpath = "/root/sexiibot/sexiibot.sock"
|
||||
try:
|
||||
sock.connect(sockpath)
|
||||
except socket.error:
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
|
||||
# Send data
|
||||
message = 'join #bordel'
|
||||
sock.sendall(bytes(message, 'UTF-8'))
|
||||
|
||||
finally:
|
||||
sock.close()
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import socket
|
||||
|
||||
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
sockpath = "/root/sexiibot/sexiibot.sock"
|
||||
try:
|
||||
sock.connect(sockpath)
|
||||
except socket.error:
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
|
||||
# Send data
|
||||
message = 'leave #bordel'
|
||||
sock.sendall(bytes(message, 'UTF-8'))
|
||||
|
||||
finally:
|
||||
sock.close()
|
||||
69
admin-scripts/sexiictl
Executable file
69
admin-scripts/sexiictl
Executable file
@@ -0,0 +1,69 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import socket
|
||||
import sys
|
||||
import os
|
||||
|
||||
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
sockpath = "/var/tmp/%s/sexiibot.sock" % os.environ["USER"]
|
||||
|
||||
logo = """\
|
||||
.-.
|
||||
(/ \)
|
||||
(\ /) SEXIIBOT : The Bot Of Your Dreams
|
||||
.-'-. Simple EXtensible II Bot
|
||||
/(_Y_)\\ v.0.1.1
|
||||
\\\\) (//
|
||||
/ \ Author: raspbeguy
|
||||
\ Y / raspbeguy@hashtagueule.fr
|
||||
\|/
|
||||
/|\ https://git.hashtagueule.fr/raspbeguy/sexiibot
|
||||
\|/
|
||||
/Y\\
|
||||
"""
|
||||
|
||||
usage = """\
|
||||
usage: %s [-p <path_to_socket>] <command>
|
||||
|
||||
To get a list of possible commands, use command "help"
|
||||
"""
|
||||
|
||||
args = sys.argv
|
||||
|
||||
if len(args) < 2:
|
||||
print(usage, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
elif args[1] == "-v":
|
||||
print(logo)
|
||||
sys.exit(0)
|
||||
elif args[1] == "-p":
|
||||
try:
|
||||
sockpath = args[2]
|
||||
except IndexError:
|
||||
print(usage, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
message = " ".join(args[3:])
|
||||
else:
|
||||
message = " ".join(args[1:])
|
||||
|
||||
try:
|
||||
print(message)
|
||||
sock.connect(sockpath)
|
||||
except socket.error:
|
||||
error = """\
|
||||
It seems that sexiibot isn't awaken.
|
||||
To start your sexiibot instance, run the following command:
|
||||
sexiictl start <config_file>
|
||||
|
||||
It is also possible than the instance of sexiibot you're trying to reach uses a different control socket.
|
||||
You can try running the following command :
|
||||
sexiictl -p <path_to_socket> """ + "".join(sys.argv[1:]) + """
|
||||
|
||||
If you need help to generate a config file, use the sexiiwizard script.
|
||||
"""
|
||||
print(error, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
try:
|
||||
sock.sendall(bytes(message, 'UTF-8'))
|
||||
finally:
|
||||
sock.close()
|
||||
Reference in New Issue
Block a user