You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
2.2 KiB
66 lines
2.2 KiB
#!/bin/bash
|
|
|
|
MY_GROUP=www-data
|
|
# Function to check if a group exists
|
|
group_exists() {
|
|
if getent group "$1" >/dev/null 2>&1; then
|
|
return 0 # Group exists
|
|
else
|
|
return 1 # Group does not exist
|
|
fi
|
|
}
|
|
|
|
if ! group_exists "$MY_GROUP"; then
|
|
groupadd "$MY_GROUP"
|
|
fi
|
|
|
|
PHPCLI='php8.3-cli'
|
|
PHPMBString='php8.3-mbstring'
|
|
|
|
if [ "$EUID" -ne 0 ]; then
|
|
/usr/bin/echo "Please run as root!"
|
|
exit
|
|
fi
|
|
|
|
current_directory=$(pwd)
|
|
target_directory="/opt/neatoDeploy"
|
|
|
|
if [ "$current_directory" == "$target_directory" ] || [ "$current_directory" == "$target_directory/build" ]; then
|
|
/usr/bin/echo "Do not run this script inside of source folder /opt/neatoDeploy/build!"
|
|
exit 1
|
|
fi
|
|
|
|
/usr/bin/mkdir -p /opt/neatoDeployments/deploy_files
|
|
/usr/bin/mv neato_deploy_php_cli.ini /opt/neatoDeployments/
|
|
/usr/bin/mv neatoDeploy.phar /opt/neatoDeployments/
|
|
/usr/bin/mv neatoDeploy.phar.pubkey /opt/neatoDeployments/
|
|
/usr/bin/mv neatoDeploy.phar.sig /opt/neatoDeployments/
|
|
/usr/bin/mv neato_deploy.sh /opt/neatoDeployments/
|
|
/usr/bin/mv make-sums.sh /opt/neatoDeployments/
|
|
/usr/bin/mv sumfiles.sig /opt/neatoDeployments/
|
|
/usr/bin/mv deploy_files/deploy_*.php /opt/neatoDeployments/deploy_files/
|
|
/usr/bin/rmdir deploy_files
|
|
|
|
pushd /opt/neatoDeployments
|
|
|
|
/usr/bin/dpkg -s software-properties-common 2>/dev/null >/dev/null || /usr/bin/apt-get install -y software-properties-common
|
|
/usr/bin/dpkg -s $PHPCLI 2>/dev/null >/dev/null || /usr/bin/add-apt-repository ppa:ondrej/php -y
|
|
/usr/bin/dpkg -s $PHPCLI 2>/dev/null >/dev/null || /usr/bin/apt-get update
|
|
/usr/bin/dpkg -s $PHPCLI 2>/dev/null >/dev/null || /usr/bin/apt-get install -y $PHPCLI
|
|
/usr/bin/dpkg -s $PHPMBString 2>/dev/null >/dev/null || /usr/bin/apt-get install -y $PHPMBString
|
|
/usr/bin/dpkg -s curl 2>/dev/null >/dev/null || /usr/bin/apt-get install -y curl
|
|
|
|
/usr/bin/chgrp $MY_GROUP neato*
|
|
/usr/bin/chgrp $MY_GROUP make-sums.sh
|
|
/usr/bin/chgrp -R $MY_GROUP deploy_files
|
|
|
|
/usr/bin/chmod 775 neatoDeploy.phar
|
|
/usr/bin/chmod 775 neato_deploy.sh
|
|
/usr/bin/chmod 775 make-sums.sh
|
|
/usr/bin/chmod 664 neato_deploy_php_cli.ini
|
|
/usr/bin/chmod 664 deploy_files/deploy_*.php
|
|
|
|
popd
|
|
|
|
/usr/bin/echo -e "\nRemove the install_neato.sh file!"
|
|
/usr/bin/echo -e "\nRemove the neato_deploy.tar.gz.self file!" |