|
|
|
|
@ -1,6 +1,13 @@ |
|
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
MY_GROUP=www-data |
|
|
|
|
PHPCLI='php8.3-cli' |
|
|
|
|
PHPMBString='php8.3-mbstring' |
|
|
|
|
|
|
|
|
|
if [ "$EUID" -ne 0 ]; then |
|
|
|
|
/usr/bin/echo "Please run as root!" |
|
|
|
|
exit |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
# Function to check if a group exists |
|
|
|
|
group_exists() { |
|
|
|
|
if getent group "$1" >/dev/null 2>&1; then |
|
|
|
|
@ -14,19 +21,11 @@ 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" |
|
|
|
|
avoid_target_directory="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!" |
|
|
|
|
if [[ $current_directory == *$avoid_target_directory ]] || [[ $current_directory == *$avoid_target_directory/build ]]; then |
|
|
|
|
/usr/bin/echo "Do not run this script inside of source folder ... neatoDeploy* !" |
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
@ -41,7 +40,7 @@ fi |
|
|
|
|
/usr/bin/mv deploy_files/deploy_*.php /opt/neatoDeployments/deploy_files/ |
|
|
|
|
/usr/bin/rmdir deploy_files |
|
|
|
|
|
|
|
|
|
pushd /opt/neatoDeployments |
|
|
|
|
pushd /opt/neatoDeployments || exit 1 |
|
|
|
|
|
|
|
|
|
/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 |
|
|
|
|
@ -60,7 +59,11 @@ pushd /opt/neatoDeployments |
|
|
|
|
/usr/bin/chmod 664 neato_deploy_php_cli.ini |
|
|
|
|
/usr/bin/chmod 664 deploy_files/deploy_*.php |
|
|
|
|
|
|
|
|
|
popd |
|
|
|
|
popd || exit 1 |
|
|
|
|
|
|
|
|
|
if [ ! -L /usr/local/bin/Neato ]; then |
|
|
|
|
ln -s /opt/neatoDeployments/neato_deploy.sh /usr/local/bin/Neato |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
/usr/bin/echo -e "\nRemove the install_neato.sh file!" |
|
|
|
|
/usr/bin/echo -e "\nRemove the neato_deploy.tar.gz.self file!" |