Improved CurseForge API key checking.
Signed-off-by: sneedium <sneed@sneedmc.org>
This commit is contained in:
parent
7addde4a40
commit
478ee95ffe
19
cf.sh
19
cf.sh
@ -1,25 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Copyleft (C) 2022 Chuckium
|
# Copyleft (C) 2022 Sneedium, Chuckium, & Fluchsneeden
|
||||||
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3.
|
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
command -v wscat &> /dev/null || { echo "YOU MUST HAVE wscat INSTALLED." 1>&2 && exit 1; }
|
curl -Ls https://fluchschmieden-entwickler-sind-alle.skids.lol/api | jq -r ".token" | tr -d '\n'
|
||||||
|
|
||||||
wget -qO- https://curseforge.overwolf.com/downloads/curseforge-latest-linux.zip | funzip > cf.AppImage
|
|
||||||
chmod +x cf.AppImage
|
|
||||||
|
|
||||||
./cf.AppImage --appimage-extract &> /dev/null
|
|
||||||
squashfs-root/resources/plugins/curse/linux/Curse.Agent.Host &> /dev/null &
|
|
||||||
|
|
||||||
sleep 15
|
|
||||||
|
|
||||||
printf '{"type":"method","id":0,"name":"getSystemProperties","args":[]}' | timeout 2 wscat -i /dev/stdin -c ws://127.0.0.1:12345/CurseForge | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" | jq -r .result.data.Ak | tr -d '\n'
|
|
||||||
|
|
||||||
rm cf.AppImage &> /dev/null
|
|
||||||
rm -rf squashfs-root &> /dev/null
|
|
||||||
|
|
||||||
kill %1
|
|
||||||
|
Loading…
Reference in New Issue
Block a user