- Replace $EUID with $(id -u) for root checks across all bin/*.sh and install.sh: dash (Debian's /bin/sh) never sets $EUID, so the check was silently broken everywhere. - lemp.sh: make apt-get upgrade non-interactive (--yes), align the Redis PHP module and php-fpm restart with $PHP_VERSION instead of a hardcoded 8.1, and template the nginx PHP-FPM socket path via a PHP_FPM_SOCK placeholder substituted at install time. - nginx-phpmyadmin.conf: fix docroot to match the actual phpMyAdmin symlink location created by lemp.sh. - mysql-db.sh: inline the root check instead of sourcing the nonexistent bin/checkroot.sh. - webhook.sh: fix chowm typo (chown). - urbackup.sh: copy the systemd unit from assets/ instead of a relative path to a file that doesn't exist in the repo. - _addUserSite.sh: fix invalid `$var=value` assignment and an empty if-block that was a POSIX sh syntax error. Also carries over pending fixes to deploy-drupal.sh (drush now invoked via vendor/bin/drush) and gitbarrerepos.sh (comment cleanup). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
90 lines
2.7 KiB
Bash
Executable File
90 lines
2.7 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
|
|
echo -e '\033[35m
|
|
_ _ _ _ ___ _ _ _
|
|
| | | |_ _| |__ __ _ __| |___ _ _ __ / __| | (_)___ _ _| |_
|
|
| |_| | _| _ \/ _` / _| / / || | _ \ | (__| |__| / -_) \ _|
|
|
\___/|_| |_.__/\__,_\__|_\_\\_,_| .__/ \___|____|_\___|_||_\__|
|
|
|_|
|
|
\033[0m'
|
|
|
|
if [ "$(id -u)" -ne 0 ]; then
|
|
echo "Please run as root"
|
|
exit
|
|
fi
|
|
|
|
# get the current position
|
|
_cwd="$(pwd)"
|
|
# check for assets forlder
|
|
_assets="$_cwd/assets"
|
|
if [ ! -d "$_assets" ]; then
|
|
_assets="$_cwd/../assets"
|
|
if [ ! -d "$_assets" ]; then
|
|
echo "!! can't find assets directory !!"
|
|
exit
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
# install urbackup client
|
|
# https://www.urbackup.org/client_debian_ubuntu_install.html
|
|
# https://blog.stephane-huc.net/systeme/debian/urbackup_client_gui
|
|
# https://urbackup.atlassian.net/wiki/spaces/US/pages/9142274/Headless+Linux+client+setup
|
|
|
|
# Install the dependencies UrBackup needs
|
|
apt install build-essential "g++" "libcrypto++-dev" libz-dev -y
|
|
# libwxgtk3.0-dev
|
|
|
|
# Download the UrBackup client source files and extract them
|
|
# wget -P /tmp/ https://hndl.urbackup.org/Client/latest/urbackup-client-2.3.4.0.tar.gz
|
|
# wget -P /tmp/ https://hndl.urbackup.org/Client/2.4.11/urbackup-client-2.4.11.0.tar.gz
|
|
# wget -P /tmp/ https://hndl.urbackup.org/Client/2.5.20/urbackup-client-2.5.20.0.tar.gz
|
|
# wget -P /tmp/ https://hndl.urbackup.org/Client/2.5.20/urbackup-client-2.5.24.0.tar.gz
|
|
wget -P /tmp/ https://hndl.urbackup.org/Client/2.5.25/urbackup-client-2.5.25.0.tar.gz
|
|
cd /tmp
|
|
|
|
tar xzf /tmp/urbackup-client-2.5.25.0.tar.gz
|
|
|
|
# Build the UrBackup client and install it
|
|
# cd /tmp/urbackup-client-2.3.4.0
|
|
cd /tmp/urbackup-client-2.5.25.0
|
|
./configure --enable-headless
|
|
make -j4
|
|
make install
|
|
|
|
# Make sure that the UrBackup client backend runs correctly
|
|
# urbackupclientbackend -v info
|
|
|
|
# configure
|
|
echo -n "Please provide the urbackup-server's ip : "
|
|
read _ip
|
|
echo -n "Please provide the internet_authkey of server : "
|
|
read _authkey
|
|
echo -n "Please provide the computer name of this client : "
|
|
read _computername
|
|
|
|
echo "internet_server=$_ip
|
|
internet_server_port=55415
|
|
internet_authkey=$_authkey
|
|
internet_mode_enabled=true
|
|
internet_image_backups_def=false
|
|
default_dirs_def=/etc;var/www;/var/backups/mysql
|
|
startup_backup_delay_def=3
|
|
computername=$_computername" > /etc/default/urbackupclient
|
|
# /usr/local/var/urbackup/data/settings.cfg
|
|
|
|
# firewall
|
|
ufw allow from "$_ip" to any port 35621
|
|
ufw allow from "$_ip" to any port 35622
|
|
ufw allow from "$_ip" to any port 35623
|
|
|
|
# install and enable systemd service
|
|
cp "$_assets"/urbackup.service /etc/systemd/system/urbackup.service
|
|
chmod a+x /etc/systemd/system/urbackup.service
|
|
|
|
systemctl --system daemon-reload
|
|
systemctl start urbackup.service
|
|
systemctl enable urbackup.service
|