- 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>
62 lines
1.3 KiB
Bash
Executable File
62 lines
1.3 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
|
|
|
|
echo "installing proftpd"
|
|
apt-get --yes install proftpd
|
|
while [ "$_server_name" = "" ]
|
|
do
|
|
read -p "enter a server name ? " _server_name
|
|
if [ "$_server_name" != "" ]; then
|
|
read -p "is server name $_server_name correcte [y|n] " validated
|
|
if [ "$validated" = "y" ]; then
|
|
break
|
|
else
|
|
_server_name=""
|
|
fi
|
|
fi
|
|
done
|
|
|
|
echo "Configuring proftpd"
|
|
cp "$_assets"/proftpd.conf /etc/proftpd/conf.d/"$_server_name".conf
|
|
sed -i -r "s/example/$_server_name/g" /etc/proftpd/conf.d/"$_server_name".conf
|
|
|
|
ufw allow ftp
|
|
|
|
addgroup ftpuser
|
|
|
|
systemctl enable proftpd
|
|
systemctl restart proftpd
|
|
|
|
echo "ftp installtion done"
|
|
echo "to permit to a user to connect through ftp, add him to the ftpuser group by running : usermod -a -G ftpuser USERNAME"
|
|
echo "FTP users are jailed on their home by default"
|
|
|
|
|
|
# TODO : allow ssh/ftp connection only from given ips
|