1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00

Move "spkifp" to unrealircdctl, so it is available for Windows users.

For *NIX users no visible change.
This commit is contained in:
Bram Matthys
2022-01-03 14:48:00 +01:00
parent 3dd7c19c77
commit 92c81b194f
2 changed files with 69 additions and 37 deletions
+6 -33
View File
@@ -88,11 +88,11 @@ elif [ "$1" = "stop" ] ; then
kill -9 `cat $PID_FILE` 1>/dev/null 2>&1
fi
elif [ "$1" = "rehash" ] ; then
$UNREALIRCDCTL rehash
$UNREALIRCDCTL $*
elif [ "$1" = "status" ] ; then
$UNREALIRCDCTL status
$UNREALIRCDCTL $*
elif [ "$1" = "reloadtls" ] ; then
$UNREALIRCDCTL reloadtls
$UNREALIRCDCTL $*
elif [ "$1" = "restart" ] ; then
echo "Restarting UnrealIRCd"
$0 stop
@@ -114,11 +114,11 @@ elif [ "$1" = "module" ] ; then
shift
@BINDIR@/unrealircd -m $*
elif [ "$1" = "mkpasswd" ] ; then
$UNREALIRCDCTL mkpasswd $2 $3
$UNREALIRCDCTL $*
elif [ "$1" = "version" ] ; then
@BINDIR@/unrealircd -v
elif [ "$1" = "gencloak" ] ; then
$UNREALIRCDCTL gencloak
$UNREALIRCDCTL $*
elif [ "$1" = "backtrace" ] ; then
cd @TMPDIR@
@@ -209,34 +209,7 @@ __EOF__
echo ""
echo "Thanks!"
elif [ "$1" = "spki" -o "$1" = "spkifp" ] ; then
CERT="@CONFDIR@/tls/server.cert.pem"
if [ "$2" != "" ]; then
CERT="$2"
else
echo "NOTE: This script uses the default certificate location (any set::tls settings"
echo "are ignored). If this is not what you want then specify a certificate"
echo "explicitly like this: ./unrealircd spkifp conf/tls/example.pem"
echo ""
fi
if [ ! -f "$CERT" ]; then
echo "Could not open certificate: $CERT"
echo "You can specify a certificate like this: ./unrealircd spkifp conf/tls/example.pem"
exit 1
fi
openssl x509 -noout -in "$CERT" -pubkey | openssl asn1parse -noout -inform pem -out @TMPDIR@/tmp.public.key
HASH="`openssl dgst -sha256 -binary @TMPDIR@/tmp.public.key | openssl enc -base64`"
rm -f @TMPDIR@/tmp.public.key
if [ "$HASH" = "" ]; then
echo "Sorry, something went wrong when generating the SPKI fingerprint."
echo "Is the 'openssl' tool properly installed?"
exit 1
fi
echo "The SPKI fingerprint for certificate $CERT is:"
echo "$HASH"
echo ""
echo "You normally add this password on the other side of the link as:"
echo "password \"$HASH\" { spkifp; };"
echo ""
$UNREALIRCDCTL $*
elif [ "$1" = "hot-patch" -o "$1" = "cold-patch" ] ; then
if [ ! -d "@BUILDDIR@" ]; then
echo "UnrealIRCd source not found. Sorry, it is not possible to patch."