| Server IP : 193.86.120.172 / Your IP : 216.73.216.67 Web Server : Apache/2.4.63 (Unix) System : Linux JServices 3.10.108 #86003 SMP Wed Oct 22 13:20:46 CST 2025 x86_64 User : kubec ( 1026) PHP Version : 8.2.28 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /volume1/@appstore/WebStation/tools/ |
Upload File : |
#!/bin/bash
WEBSTATION_VAR="/var/packages/WebStation/var/"
curl https://pypi.org/simple/ -o "${WEBSTATION_VAR}python_packages.html" -D "${WEBSTATION_VAR}response_header"
if [ $? -eq 0 ]; then
X_PYPI_LAST_SERIAL=$(grep -m 1 -r "x-pypi-last-serial" "${WEBSTATION_VAR}response_header" | grep -P -o "\d+")
if [ ! -z "$X_PYPI_LAST_SERIAL" ]; then
if [[ ! -f "${WEBSTATION_VAR}x-pypi-last-serial" || $X_PYPI_LAST_SERIAL != $(cat "${WEBSTATION_VAR}x-pypi-last-serial") ]]; then
sed -n 's,.*href="/simple/.*>\(.*\)<.*$,\1,p' "${WEBSTATION_VAR}python_packages.html" > "${WEBSTATION_VAR}python_packages.csv.tmp"
mv -f "${WEBSTATION_VAR}python_packages.csv.tmp" "${WEBSTATION_VAR}python_packages.csv"
chmod 644 "${WEBSTATION_VAR}python_packages.csv"
echo $X_PYPI_LAST_SERIAL > "${WEBSTATION_VAR}x-pypi-last-serial"
fi
fi
rm "${WEBSTATION_VAR}python_packages.html" "${WEBSTATION_VAR}response_header"
fi
exit 0