Update install.sh for single-script install capability

This commit is contained in:
2026-01-01 22:24:31 +11:00
parent 78a879015b
commit ebfac8de92

View File

@@ -505,6 +505,28 @@ echo 'www-data ALL=(ALL) NOPASSWD: /usr/bin/pkill *' >> /etc/sudoers.d/www-data-
echo 'www-data ALL=(ALL) NOPASSWD: /usr/bin/rm *' >> /etc/sudoers.d/www-data-sniper
chmod 440 /etc/sudoers.d/www-data-sniper
# Configure Git Safe Directory
echo -e "$OKBLUE[*]$RESET Configuring Git permissions... $RESET"
git config --system --add safe.directory /usr/share/sniper 2>/dev/null
git config --global --add safe.directory /usr/share/sniper 2>/dev/null
# Generate Version File
echo -e "$OKBLUE[*]$RESET Generating version information... $RESET"
cd $INSTALL_DIR
git rev-parse --short HEAD > /var/www/html/ultyscan/.version 2>/dev/null
git rev-parse HEAD >> /var/www/html/ultyscan/.version 2>/dev/null
git rev-parse --abbrev-ref HEAD >> /var/www/html/ultyscan/.version 2>/dev/null
git log -1 --format=%ci >> /var/www/html/ultyscan/.version 2>/dev/null
chown www-data:www-data /var/www/html/ultyscan/.version 2>/dev/null
# Deploy Secrets
echo -e "$OKBLUE[*]$RESET Deploying secrets configuration... $RESET"
if [ -f "$INSTALL_DIR/secrets.php" ]; then
cp $INSTALL_DIR/secrets.php /var/www/html/secrets.php
chown www-data:www-data /var/www/html/secrets.php
chmod 640 /var/www/html/secrets.php
fi
# Configure Apache Port 8888
echo -e "$OKBLUE[*]$RESET Configuring Apache on port 8888... $RESET"
if ! grep -q "Listen 8888" /etc/apache2/ports.conf; then