mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-25 00:50:29 +00:00
check if python is present
This commit is contained in:
parent
ccd0d62a5a
commit
8eae2d1606
1 changed files with 11 additions and 0 deletions
|
@ -585,6 +585,17 @@ function _create_openvpn_scripts() {
|
|||
function _install_restapi() {
|
||||
_install_log "Installing and enabling RestAPI"
|
||||
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"
|
||||
|
||||
echo "Moving restapi systemd unit control file to /lib/systemd/system/"
|
||||
|
|
Loading…
Reference in a new issue