mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
check if python is present
This commit is contained in:
parent
ccd0d62a5a
commit
8eae2d1606
@ -585,6 +585,17 @@ function _create_openvpn_scripts() {
|
|||||||
function _install_restapi() {
|
function _install_restapi() {
|
||||||
_install_log "Installing and enabling RestAPI"
|
_install_log "Installing and enabling RestAPI"
|
||||||
sudo cp -r "$webroot_dir/api" "$raspap_dir/api" || _install_status 1 "Unable to move api folder"
|
sudo cp -r "$webroot_dir/api" "$raspap_dir/api" || _install_status 1 "Unable to move api folder"
|
||||||
|
|
||||||
|
if ! command -v python &> /dev/null; then
|
||||||
|
echo "Python is not installed. Installing Python..."
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y python3 python3-pip
|
||||||
|
echo "Python installed successfully."
|
||||||
|
else
|
||||||
|
echo "Python is already installed."
|
||||||
|
sudo apt install python3-pip -y
|
||||||
|
|
||||||
|
fi
|
||||||
python -m pip install -r "$raspap_dir/api/requirements.txt" --break-system-packages || _install_status 1 " Unable to install pip modules"
|
python -m pip install -r "$raspap_dir/api/requirements.txt" --break-system-packages || _install_status 1 " Unable to install pip modules"
|
||||||
|
|
||||||
echo "Moving restapi systemd unit control file to /lib/systemd/system/"
|
echo "Moving restapi systemd unit control file to /lib/systemd/system/"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user