If you have a non-standard Pterodactyl setup, you might want to modify our install script - instead of pasting the install command directly into CLI. Specifically, the parts which you might need to modify are the following functions:
check_for_wings() {
debug "Checking for wings presence..."
# TODO: Forever
if [[ -d /srv/daemon ]]; then
debug "Default installation location for wings present."
WORKING_DIR="/srv/daemon"
fi
local WORKING_DIR
if [[ -f /etc/systemd/system/wings.service ]]; then
debug "Wings systemd service present."
local TMP_WORKING_DIR=$(cat /etc/systemd/system/wings.service | grep WorkingDirectory)
WORKING_DIR=${TMP_WORKING_DIR:17}
fi
if [[ ! -z "$WORKING_DIR" ]]; then
debug "The working directory for the daemon is $WORKING_DIR."
if [[ -f "$WORKING_DIR/src/index.js" ]]; then
debug "Files are intact, deciding that daemon is installed."
declare -g "$1=$WORKING_DIR"
else
debug "Files are not intact, assuming no wings present on the system."
fi
else
debug "Couldn't find wings directory, assuming no wings present on the system."
fi
}
stop_wings() {
debug "Checking if wings is running..."
if [[ "$(ps aux | grep "node $WINGS_DIR" | wc -l)" -gt "1" ]]; then
debug "Wings is running, finding the method it runs with..."
if [[ -f "/etc/systemd/system/wings.service" ]]; then
debug "Wings systemd service present, using it to stop it..."
systemctl stop wings > /dev/null 2>&1
systemctl disable wings > /dev/null 2>&1
else
fatal "Couldn't find out how wings is running, please stop it and run this script again."
fi
else
debug "Wings isn't running."
fi
}
stop_sftp() {
debug "Checking if sftp-server is running..."
if [[ "$(ps aux | grep sftp-server | wc -l)" -gt "1" ]]; then
debug "Sftp-server is running, finding the method it runs with..."
if [[ -f "/etc/systemd/system/pterosftp.service" ]]; then
debug "Sftp-server systemd service present, using it to stop it..."
systemctl stop pterosftp > /dev/null 2>&1
systemctl disable pterosftp > /dev/null 2>&1
else
if [[ "$(netstat -tulpn | grep :2022 | wc -l)" -gt "0" ]]; then
fatal "Couldn't find out how sftp-server is running, please stop it and run this script again."
fi
fi
fi
}
get_wings_data_dir() {
if [[ -d "/srv/daemon-data" ]]; then
declare -g "$1=/srv/daemon-data/"
else
if [[ -f "$WINGS_DIR/config/core.json" ]]; then
RES=$(cat $WINGS_DIR/config/core.json | egrep "\\"path\\": \\"/(.*?)\\"" | egrep -o "/(.*?)" | sed "s/\\",//")
declare -g $1=RES
else
fatal "Couldn't find the daemon config file in $WINGS_DIR/config/."
fi
fi
}