#!/bin/bash #################################################################################################### #### author: SlickStack ############################################################################ #### link: https://slickstack.io ################################################################### #### mirror: http://mirrors.slickstack.io/bash/ss-check.txt ######################################## #### path: /var/www/bash/ss-check ################################################################## #### destination: n/a (not a boilerplate) ########################################################## #### purpose: Retrieves latest ss core cron jobs and ss core bash scripts (except ss-check) ######## #### module version: Ubuntu 20.04 LTS ############################################################## #### sourced by: ss-install, ss-update, ss core cron jobs ########################################## #### bash aliases: ss check ######################################################################## #################################################################################################### ## include SlickStack configuration ## source /var/www/ss-config ## include SlickStack functions ## source /var/www/ss-functions #################################################################################################### #### SS-Check: Message (Begin Script) ############################################################## #################################################################################################### ## this is a simple message that announces to the shell the purpose of this bash script ## ## it will only be noticed by sudo users who manually call ss core bash scripts ## ## echo message ## echo -e "${PURPLE}Running ss-check: Retrieves latest ss core cron jobs and ss core bash scripts (except ss-check)... ${NOCOLOR}" sleep "$SLEEP_MESSAGE_BEGIN" #################################################################################################### #### SS-Check: Cleanup Temporary Files ############################################################# #################################################################################################### ## delete tmp files ## rm /tmp/ss* rm /tmp/*cron* #################################################################################################### #### SS-Worker: Reset Permissions (SlickStack Core + SlickStack Config) ############################ #################################################################################################### ## SNIPPET: ss-check, ss-worker, ss-update ## because SlickStack core permissions are critical this is hardcoded in multiple scripts ## ## this ensures that permissions are reset regularly and do not rely on sourcing ## ## ensure core directories exist ## mkdir /var/www mkdir /var/www/bash mkdir /var/www/cache mkdir /var/www/cache/fastcgi mkdir /var/www/cache/opcache mkdir /var/www/certs mkdir /var/www/certs/keys mkdir /var/www/crons mkdir /var/www/html mkdir /var/www/logs mkdir /var/www/meta mkdir /var/www/sites ## ssl certs slickstack ## chown root:root /var/www/certs chown root:root /var/www/certs/keys chmod 0755 /var/www/certs ## must be 0755 chmod 0700 /var/www/certs/keys ## must be 0700 chmod 0644 /var/www/certs/*.crt ## must be 0644 chmod 0644 /var/www/certs/*.pem ## must be 0644 chmod 0600 /var/www/certs/keys/*.key ## must be 0600 chmod 0600 /var/www/certs/keys/*.pem ## must be 0600 ## bash dir ## chown root:root /var/www/bash ## must be root:root chmod 0755 /var/www/bash ## must be 0755 ## crons dir ## chown root:root /var/www/crons ## must be root:root chmod 0755 /var/www/crons ## must be 0755 ## chroot (SFTP) user directory ## chown root:root /var ## must be root:root chown root:root /var/www ## must be root:root chmod 0755 /var/www ## must be 0755 ## its okay if the SFTP user accesses this stuff (but www-data access is the priority) ## chown www-data:www-data /var/www/cache ## must be www-data:www-data chown www-data:www-data /var/www/logs ## must be www-data:www-data chown www-data:www-data /var/www/meta ## must be www-data:www-data chmod 0775 /var/www/cache ## 6755 should also work chmod 0775 /var/www/logs ## 6755 should also work chmod 0775 /var/www/meta ## 6755 should also work #################################################################################################### #### SS-Check: Retrieve Latest SlickStack Core Files (Except SS-Check) ############################# #################################################################################################### ## here we retrieve all the latest ss core cron jobs and bash scripts to keep them updated ## ## this process does not affect ss-config or LEMP modules, nor the ss-check file ## ## retrieve latest ss core cron jobs ## wget -O /tmp/00-crontab http://mirrors.slickstack.io/crons/00-crontab.txt wget -O /tmp/01-cron-often http://mirrors.slickstack.io/crons/01-cron-often.txt wget -O /tmp/02-cron-regular http://mirrors.slickstack.io/crons/02-cron-regular.txt wget -O /tmp/03-cron-quarter-hourly http://mirrors.slickstack.io/crons/03-cron-quarter-hourly.txt wget -O /tmp/04-cron-half-hourly http://mirrors.slickstack.io/crons/04-cron-half-hourly.txt wget -O /tmp/05-cron-hourly http://mirrors.slickstack.io/crons/05-cron-hourly.txt wget -O /tmp/06-cron-quarter-daily http://mirrors.slickstack.io/crons/06-cron-quarter-daily.txt wget -O /tmp/07-cron-half-daily http://mirrors.slickstack.io/crons/07-cron-half-daily.txt wget -O /tmp/08-cron-daily http://mirrors.slickstack.io/crons/08-cron-daily.txt wget -O /tmp/09-cron-half-weekly http://mirrors.slickstack.io/crons/09-cron-half-weekly.txt wget -O /tmp/10-cron-weekly http://mirrors.slickstack.io/crons/10-cron-weekly.txt wget -O /tmp/11-cron-half-monthly http://mirrors.slickstack.io/crons/11-cron-half-monthly.txt wget -O /tmp/12-cron-monthly http://mirrors.slickstack.io/crons/12-cron-monthly.txt wget -O /tmp/13-cron-sometimes http://mirrors.slickstack.io/crons/13-cron-sometimes.txt ## retrieve latest ss core bash scripts (except ss-check) ## wget -O /tmp/ss-clean-files http://mirrors.slickstack.io/bash/ss-clean-files.txt wget -O /tmp/ss-config-sample http://mirrors.slickstack.io/bash/ss-config-sample.txt wget -O /tmp/ss-delete-database http://mirrors.slickstack.io/bash/ss-delete-database.txt wget -O /tmp/ss-delete-files http://mirrors.slickstack.io/bash/ss-delete-files.txt wget -O /tmp/ss-dos2unix http://mirrors.slickstack.io/bash/ss-dos2unix.txt wget -O /tmp/ss-dump-database http://mirrors.slickstack.io/bash/ss-dump-database.txt wget -O /tmp/ss-encrypt http://mirrors.slickstack.io/bash/ss-encrypt.txt wget -O /tmp/ss-encrypt-certbot http://mirrors.slickstack.io/bash/ss-encrypt-certbot.txt wget -O /tmp/ss-encrypt-openssl http://mirrors.slickstack.io/bash/ss-encrypt-openssl.txt wget -O /tmp/ss-functions http://mirrors.slickstack.io/bash/ss-functions.txt wget -O /tmp/ss-import http://mirrors.slickstack.io/bash/ss-import.txt wget -O /tmp/ss-import-database http://mirrors.slickstack.io/bash/ss-import-database.txt wget -O /tmp/ss-import-files http://mirrors.slickstack.io/bash/ss-import-files.txt wget -O /tmp/ss-install http://mirrors.slickstack.io/bash/ss-install.txt wget -O /tmp/ss-install-adminer http://mirrors.slickstack.io/bash/ss-install-adminer.txt wget -O /tmp/ss-install-clamav http://mirrors.slickstack.io/bash/ss-install-clamav.txt wget -O /tmp/ss-install-craft-config http://mirrors.slickstack.io/bash/ss-install-craft-config.txt wget -O /tmp/ss-install-craft-core http://mirrors.slickstack.io/bash/ss-install-craft-core.txt wget -O /tmp/ss-install-magento-config http://mirrors.slickstack.io/bash/ss-install-magento-config.txt wget -O /tmp/ss-install-magento-core http://mirrors.slickstack.io/bash/ss-install-magento-core.txt wget -O /tmp/ss-install-mediawiki-config http://mirrors.slickstack.io/bash/ss-install-mediawiki-config.txt wget -O /tmp/ss-install-mediawiki-core http://mirrors.slickstack.io/bash/ss-install-mediawiki-core.txt wget -O /tmp/ss-install-moodle-config http://mirrors.slickstack.io/bash/ss-install-moodle-config.txt wget -O /tmp/ss-install-moodle-core http://mirrors.slickstack.io/bash/ss-install-moodle-core.txt wget -O /tmp/ss-install-mysql http://mirrors.slickstack.io/bash/ss-install-mysql.txt wget -O /tmp/ss-install-nginx http://mirrors.slickstack.io/bash/ss-install-nginx.txt wget -O /tmp/ss-install-nginx-config http://mirrors.slickstack.io/bash/ss-install-nginx-config.txt wget -O /tmp/ss-install-nginx-core http://mirrors.slickstack.io/bash/ss-install-nginx-core.txt wget -O /tmp/ss-install-nginx-ssl http://mirrors.slickstack.io/bash/ss-install-nginx-ssl.txt wget -O /tmp/ss-install-nginx-openssl http://mirrors.slickstack.io/bash/ss-install-nginx-openssl.txt wget -O /tmp/ss-install-nginx-letsencrypt http://mirrors.slickstack.io/bash/ss-install-nginx-letsencrypt.txt wget -O /tmp/ss-install-opencart-config http://mirrors.slickstack.io/bash/ss-install-opencart-config.txt wget -O /tmp/ss-install-opencart-core http://mirrors.slickstack.io/bash/ss-install-opencart-core.txt wget -O /tmp/ss-install-php http://mirrors.slickstack.io/bash/ss-install-php.txt wget -O /tmp/ss-install-php-config http://mirrors.slickstack.io/bash/ss-install-php-config.txt wget -O /tmp/ss-install-php-core http://mirrors.slickstack.io/bash/ss-install-php-core.txt wget -O /tmp/ss-install-postfix http://mirrors.slickstack.io/bash/ss-install-postfix.txt wget -O /tmp/ss-install-prestashop-config http://mirrors.slickstack.io/bash/ss-install-prestashop-config.txt wget -O /tmp/ss-install-prestashop-core http://mirrors.slickstack.io/bash/ss-install-prestashop-core.txt wget -O /tmp/ss-install-redis http://mirrors.slickstack.io/bash/ss-install-redis.txt wget -O /tmp/ss-install-ubuntu-bash http://mirrors.slickstack.io/bash/ss-install-ubuntu-bash.txt wget -O /tmp/ss-install-ubuntu-crontab http://mirrors.slickstack.io/bash/ss-install-ubuntu-crontab.txt wget -O /tmp/ss-install-ubuntu-kernel http://mirrors.slickstack.io/bash/ss-install-ubuntu-kernel.txt wget -O /tmp/ss-install-ubuntu-ssh http://mirrors.slickstack.io/bash/ss-install-ubuntu-ssh.txt wget -O /tmp/ss-install-ubuntu-users http://mirrors.slickstack.io/bash/ss-install-ubuntu-users.txt wget -O /tmp/ss-install-ubuntu-utils http://mirrors.slickstack.io/bash/ss-install-ubuntu-utils.txt wget -O /tmp/ss-install-ufw http://mirrors.slickstack.io/bash/ss-install-ufw.txt wget -O /tmp/ss-install-ufw-config http://mirrors.slickstack.io/bash/ss-install-ufw-config.txt wget -O /tmp/ss-install-ufw-core http://mirrors.slickstack.io/bash/ss-install-ufw-core.txt wget -O /tmp/ss-install-wordpress-cli http://mirrors.slickstack.io/bash/ss-install-wordpress-cli.txt wget -O /tmp/ss-install-wordpress-config http://mirrors.slickstack.io/bash/ss-install-wordpress-config.txt wget -O /tmp/ss-install-wordpress-core http://mirrors.slickstack.io/bash/ss-install-wordpress-core.txt wget -O /tmp/ss-install-wordpress-mu-plugins http://mirrors.slickstack.io/bash/ss-install-wordpress-mu-plugins.txt wget -O /tmp/ss-maintenance-disable http://mirrors.slickstack.io/bash/ss-maintenance-disable.txt wget -O /tmp/ss-maintenance-enable http://mirrors.slickstack.io/bash/ss-maintenance-enable.txt wget -O /tmp/ss-monitor http://mirrors.slickstack.io/bash/ss-monitor.txt wget -O /tmp/ss-optimize-database http://mirrors.slickstack.io/bash/ss-optimize-database.txt wget -O /tmp/ss-overview http://mirrors.slickstack.io/bash/ss-overview.txt wget -O /tmp/ss-perms http://mirrors.slickstack.io/bash/ss-perms.txt wget -O /tmp/ss-perms-adminer http://mirrors.slickstack.io/bash/ss-perms-adminer.txt wget -O /tmp/ss-perms-clamav http://mirrors.slickstack.io/bash/ss-perms-clamav.txt wget -O /tmp/ss-perms-craft-config http://mirrors.slickstack.io/bash/ss-perms-craft-config.txt wget -O /tmp/ss-perms-craft-core http://mirrors.slickstack.io/bash/ss-perms-craft-core.txt wget -O /tmp/ss-perms-magento-config http://mirrors.slickstack.io/bash/ss-perms-magento-config.txt wget -O /tmp/ss-perms-magento-core http://mirrors.slickstack.io/bash/ss-perms-magento-core.txt wget -O /tmp/ss-perms-mediawiki-config http://mirrors.slickstack.io/bash/ss-perms-mediawiki-config.txt wget -O /tmp/ss-perms-mediawiki-core http://mirrors.slickstack.io/bash/ss-perms-mediawiki-core.txt wget -O /tmp/ss-perms-moodle-config http://mirrors.slickstack.io/bash/ss-perms-moodle-config.txt wget -O /tmp/ss-perms-moodle-core http://mirrors.slickstack.io/bash/ss-perms-moodle-core.txt wget -O /tmp/ss-perms-mysql http://mirrors.slickstack.io/bash/ss-perms-mysql.txt wget -O /tmp/ss-perms-nginx http://mirrors.slickstack.io/bash/ss-perms-nginx.txt wget -O /tmp/ss-perms-nginx-config http://mirrors.slickstack.io/bash/ss-perms-nginx-config.txt wget -O /tmp/ss-perms-nginx-core http://mirrors.slickstack.io/bash/ss-perms-nginx-core.txt wget -O /tmp/ss-perms-nginx-ssl http://mirrors.slickstack.io/bash/ss-perms-nginx-ssl.txt wget -O /tmp/ss-perms-opencart-config http://mirrors.slickstack.io/bash/ss-perms-opencart-config.txt wget -O /tmp/ss-perms-opencart-core http://mirrors.slickstack.io/bash/ss-perms-opencart-core.txt wget -O /tmp/ss-perms-php http://mirrors.slickstack.io/bash/ss-perms-php.txt wget -O /tmp/ss-perms-postfix http://mirrors.slickstack.io/bash/ss-perms-postfix.txt wget -O /tmp/ss-perms-prestashop-config http://mirrors.slickstack.io/bash/ss-perms-prestashop-config.txt wget -O /tmp/ss-perms-prestashop-core http://mirrors.slickstack.io/bash/ss-perms-prestashop-core.txt wget -O /tmp/ss-perms-redis http://mirrors.slickstack.io/bash/ss-perms-redis.txt wget -O /tmp/ss-perms-wordpress-cli http://mirrors.slickstack.io/bash/ss-perms-wordpress-cli.txt wget -O /tmp/ss-perms-wordpress-config http://mirrors.slickstack.io/bash/ss-perms-wordpress-config.txt wget -O /tmp/ss-perms-wordpress-core http://mirrors.slickstack.io/bash/ss-perms-wordpress-core.txt wget -O /tmp/ss-perms-wordpress-mu-plugins http://mirrors.slickstack.io/bash/ss-perms-wordpress-mu-plugins.txt wget -O /tmp/ss-perms-ubuntu-bash http://mirrors.slickstack.io/bash/ss-perms-ubuntu-bash.txt wget -O /tmp/ss-perms-ubuntu-crontab http://mirrors.slickstack.io/bash/ss-perms-ubuntu-crontab.txt wget -O /tmp/ss-perms-ubuntu-kernel http://mirrors.slickstack.io/bash/ss-perms-ubuntu-kernel.txt wget -O /tmp/ss-perms-ubuntu-ssh http://mirrors.slickstack.io/bash/ss-perms-ubuntu-ssh.txt wget -O /tmp/ss-perms-ubuntu-users http://mirrors.slickstack.io/bash/ss-perms-ubuntu-users.txt wget -O /tmp/ss-perms-ubuntu-utils http://mirrors.slickstack.io/bash/ss-perms-ubuntu-utils.txt wget -O /tmp/ss-perms-ufw http://mirrors.slickstack.io/bash/ss-perms-ufw.txt wget -O /tmp/ss-purge http://mirrors.slickstack.io/bash/ss-purge.txt wget -O /tmp/ss-purge-nginx http://mirrors.slickstack.io/bash/ss-purge-nginx.txt wget -O /tmp/ss-purge-opcache http://mirrors.slickstack.io/bash/ss-purge-opcache.txt wget -O /tmp/ss-purge-redis http://mirrors.slickstack.io/bash/ss-purge-redis.txt wget -O /tmp/ss-purge-transients http://mirrors.slickstack.io/bash/ss-purge-transients.txt wget -O /tmp/ss-reboot http://mirrors.slickstack.io/bash/ss-reboot.txt wget -O /tmp/ss-remote http://mirrors.slickstack.io/bash/ss-remote.txt wget -O /tmp/ss-reset-logs http://mirrors.slickstack.io/bash/ss-reset-logs.txt wget -O /tmp/ss-reset-password-sftp http://mirrors.slickstack.io/bash/ss-reset-password-sftp.txt wget -O /tmp/ss-restart-services http://mirrors.slickstack.io/bash/ss-restart-services.txt wget -O /tmp/ss-restart-services-nginx http://mirrors.slickstack.io/bash/ss-restart-services-nginx.txt wget -O /tmp/ss-restart-services-php http://mirrors.slickstack.io/bash/ss-restart-services-php.txt wget -O /tmp/ss-scan-malware http://mirrors.slickstack.io/bash/ss-scan-malware.txt wget -O /tmp/ss-sync-staging http://mirrors.slickstack.io/bash/ss-sync-staging.txt wget -O /tmp/ss-update http://mirrors.slickstack.io/bash/ss-update.txt wget -O /tmp/ss-update-config http://mirrors.slickstack.io/bash/ss-update-config.txt wget -O /tmp/ss-update-packages http://mirrors.slickstack.io/bash/ss-update-packages.txt wget -O /tmp/ss-worker http://mirrors.slickstack.io/bash/ss-worker.txt #################################################################################################### #### SS-Check: Copy Latest SlickStack Core Files To /var/www/crons/ and /var/www/bash/ ############# #################################################################################################### ## here we copy all the downloaded core files to the proper folders where they remain ## ## the root crontab runs the core cron jobs which in turn run the bash scripts ## ## move (install) ss core cron jobs ## cp /tmp/00-crontab /var/www/crons/00-crontab cp /tmp/01-cron-often /var/www/crons/01-cron-often cp /tmp/02-cron-regular /var/www/crons/02-cron-regular cp /tmp/03-cron-quarter-hourly /var/www/crons/03-cron-quarter-hourly cp /tmp/04-cron-half-hourly /var/www/crons/04-cron-half-hourly cp /tmp/05-cron-hourly /var/www/crons/05-cron-hourly cp /tmp/06-cron-quarter-daily /var/www/crons/06-cron-quarter-daily cp /tmp/07-cron-half-daily /var/www/crons/07-cron-half-daily cp /tmp/08-cron-daily /var/www/crons/08-cron-daily cp /tmp/09-cron-half-weekly /var/www/crons/09-cron-half-weekly cp /tmp/10-cron-weekly /var/www/crons/10-cron-weekly cp /tmp/11-cron-half-monthly /var/www/crons/11-cron-half-monthly cp /tmp/12-cron-monthly /var/www/crons/12-cron-monthly cp /tmp/13-cron-sometimes /var/www/crons/13-cron-sometimes ## OLD (DELETE LATER) ## ## move (install) ss core bash scripts ## cp /tmp/ss-clean-files /var/www/ss-clean-files cp /tmp/ss-config-sample /var/www/ss-config-sample cp /tmp/ss-delete-database /var/www/ss-delete-database cp /tmp/ss-delete-files /var/www/ss-delete-files cp /tmp/ss-dos2unix /var/www/ss-dos2unix cp /tmp/ss-dump-database /var/www/ss-dump-database cp /tmp/ss-encrypt /var/www/ss-encrypt cp /tmp/ss-encrypt-certbot /var/www/ss-encrypt-certbot cp /tmp/ss-encrypt-openssl /var/www/ss-encrypt-openssl cp /tmp/ss-functions /var/www/ss-functions cp /tmp/ss-import /var/www/ss-import cp /tmp/ss-import-database /var/www/ss-import-database cp /tmp/ss-import-files /var/www/ss-import-files cp /tmp/ss-install /var/www/ss-install cp /tmp/ss-install-adminer /var/www/ss-install-adminer cp /tmp/ss-install-clamav /var/www/ss-install-clamav cp /tmp/ss-install-craft-config /var/www/ss-install-craft-config cp /tmp/ss-install-craft-core /var/www/ss-install-craft-core cp /tmp/ss-install-magento-config /var/www/ss-install-magento-config cp /tmp/ss-install-magento-core /var/www/ss-install-magento-core cp /tmp/ss-install-mediawiki-config /var/www/ss-install-mediawiki-config cp /tmp/ss-install-mediawiki-core /var/www/ss-install-mediawiki-core cp /tmp/ss-install-moodle-config /var/www/ss-install-moodle-config cp /tmp/ss-install-moodle-core /var/www/ss-install-moodle-core cp /tmp/ss-install-mysql /var/www/ss-install-mysql cp /tmp/ss-install-nginx /var/www/ss-install-nginx cp /tmp/ss-install-nginx-config /var/www/ss-install-nginx-config cp /tmp/ss-install-nginx-core /var/www/ss-install-nginx-core cp /tmp/ss-install-nginx-ssl /var/www/ss-install-nginx-ssl cp /tmp/ss-install-nginx-openssl /var/www/ss-install-nginx-openssl cp /tmp/ss-install-nginx-letsencrypt /var/www/ss-install-nginx-letsencrypt cp /tmp/ss-install-opencart-config /var/www/ss-install-opencart-config cp /tmp/ss-install-opencart-core /var/www/ss-install-opencart-core cp /tmp/ss-install-php /var/www/ss-install-php cp /tmp/ss-install-php-config /var/www/ss-install-php-config cp /tmp/ss-install-php-core /var/www/ss-install-php-core cp /tmp/ss-install-postfix /var/www/ss-install-postfix cp /tmp/ss-install-prestashop-config /var/www/ss-install-prestashop-config cp /tmp/ss-install-prestashop-core /var/www/ss-install-prestashop-core cp /tmp/ss-install-redis /var/www/ss-install-redis cp /tmp/ss-install-ubuntu-bash /var/www/ss-install-ubuntu-bash cp /tmp/ss-install-ubuntu-crontab /var/www/ss-install-ubuntu-crontab cp /tmp/ss-install-ubuntu-kernel /var/www/ss-install-ubuntu-kernel cp /tmp/ss-install-ubuntu-ssh /var/www/ss-install-ubuntu-ssh cp /tmp/ss-install-ubuntu-users /var/www/ss-install-ubuntu-users cp /tmp/ss-install-ubuntu-utils /var/www/ss-install-ubuntu-utils cp /tmp/ss-install-ufw /var/www/ss-install-ufw cp /tmp/ss-install-ufw-config /var/www/ss-install-ufw-config cp /tmp/ss-install-ufw-core /var/www/ss-install-ufw-core cp /tmp/ss-install-wordpress-cli /var/www/ss-install-wordpress-cli cp /tmp/ss-install-wordpress-config /var/www/ss-install-wordpress-config cp /tmp/ss-install-wordpress-core /var/www/ss-install-wordpress-core cp /tmp/ss-install-wordpress-mu-plugins /var/www/ss-install-wordpress-mu-plugins cp /tmp/ss-maintenance-disable /var/www/ss-maintenance-disable cp /tmp/ss-maintenance-enable /var/www/ss-maintenance-enable cp /tmp/ss-monitor /var/www/ss-monitor cp /tmp/ss-optimize-database /var/www/ss-optimize-database cp /tmp/ss-overview /var/www/ss-overview cp /tmp/ss-perms /var/www/ss-perms cp /tmp/ss-perms-adminer /var/www/ss-perms-adminer cp /tmp/ss-perms-clamav /var/www/ss-perms-clamav cp /tmp/ss-perms-craft-config /var/www/ss-perms-craft-config cp /tmp/ss-perms-craft-core /var/www/ss-perms-craft-core cp /tmp/ss-perms-magento-config /var/www/ss-perms-magento-config cp /tmp/ss-perms-magento-core /var/www/ss-perms-magento-core cp /tmp/ss-perms-mediawiki-config /var/www/ss-perms-mediawiki-config cp /tmp/ss-perms-mediawiki-core /var/www/ss-perms-mediawiki-core cp /tmp/ss-perms-moodle-config /var/www/ss-perms-moodle-config cp /tmp/ss-perms-moodle-core /var/www/ss-perms-moodle-core cp /tmp/ss-perms-mysql /var/www/ss-perms-mysql cp /tmp/ss-perms-nginx /var/www/ss-perms-nginx cp /tmp/ss-perms-nginx-config /var/www/ss-perms-nginx-config cp /tmp/ss-perms-nginx-core /var/www/ss-perms-nginx-core cp /tmp/ss-perms-nginx-ssl /var/www/ss-perms-nginx-ssl cp /tmp/ss-perms-nginx-openssl /var/www/ss-perms-nginx-openssl cp /tmp/ss-perms-nginx-letsencrypt /var/www/ss-perms-nginx-letsencrypt cp /tmp/ss-perms-opencart-config /var/www/ss-perms-opencart-config cp /tmp/ss-perms-opencart-core /var/www/ss-perms-opencart-core cp /tmp/ss-perms-php /var/www/ss-perms-php cp /tmp/ss-perms-postfix /var/www/ss-perms-postfix cp /tmp/ss-perms-prestashop-config /var/www/ss-perms-prestashop-config cp /tmp/ss-perms-prestashop-core /var/www/ss-perms-prestashop-core cp /tmp/ss-perms-redis /var/www/ss-perms-redis cp /tmp/ss-perms-ubuntu-bash /var/www/ss-perms-ubuntu-bash cp /tmp/ss-perms-ubuntu-crontab /var/www/ss-perms-ubuntu-crontab cp /tmp/ss-perms-ubuntu-kernel /var/www/ss-perms-ubuntu-kernel cp /tmp/ss-perms-ubuntu-ssh /var/www/ss-perms-ubuntu-ssh cp /tmp/ss-perms-ubuntu-users /var/www/ss-perms-ubuntu-users cp /tmp/ss-perms-ubuntu-utils /var/www/ss-perms-ubuntu-utils cp /tmp/ss-perms-ufw /var/www/ss-perms-ufw cp /tmp/ss-perms-wordpress-cli /var/www/ss-perms-wordpress-cli cp /tmp/ss-perms-wordpress-config /var/www/ss-perms-wordpress-config cp /tmp/ss-perms-wordpress-core /var/www/ss-perms-wordpress-core cp /tmp/ss-perms-wordpress-mu-plugins /var/www/ss-perms-wordpress-mu-plugins cp /tmp/ss-purge /var/www/ss-purge cp /tmp/ss-purge-nginx /var/www/ss-purge-nginx cp /tmp/ss-purge-opcache /var/www/ss-purge-opcache cp /tmp/ss-purge-redis /var/www/ss-purge-redis cp /tmp/ss-purge-transients /var/www/ss-purge-transients cp /tmp/ss-reboot /var/www/ss-reboot cp /tmp/ss-remote /var/www/ss-remote cp /tmp/ss-reset-logs /var/www/ss-reset-logs cp /tmp/ss-reset-password-sftp /var/www/ss-reset-password-sftp cp /tmp/ss-restart-services /var/www/ss-restart-services cp /tmp/ss-restart-services-nginx /var/www/ss-restart-services-nginx cp /tmp/ss-restart-services-php /var/www/ss-restart-services-php cp /tmp/ss-scan-malware /var/www/ss-scan-malware cp /tmp/ss-sync-staging /var/www/ss-sync-staging cp /tmp/ss-update /var/www/ss-update cp /tmp/ss-update-config /var/www/ss-update-config cp /tmp/ss-update-packages /var/www/ss-update-packages cp /tmp/ss-worker /var/www/ss-worker ## NEW ## ## move (install) ss core bash scripts ## cp /tmp/ss-clean-files /var/www/bash/ss-clean-files cp /tmp/ss-config-sample /var/www/bash/ss-config-sample cp /tmp/ss-delete-database /var/www/bash/ss-delete-database cp /tmp/ss-delete-files /var/www/bash/ss-delete-files cp /tmp/ss-dos2unix /var/www/bash/ss-dos2unix cp /tmp/ss-dump-database /var/www/bash/ss-dump-database cp /tmp/ss-encrypt /var/www/bash/ss-encrypt cp /tmp/ss-encrypt-certbot /var/www/bash/ss-encrypt-certbot cp /tmp/ss-encrypt-openssl /var/www/bash/ss-encrypt-openssl cp /tmp/ss-functions /var/www/bash/ss-functions cp /tmp/ss-import /var/www/bash/ss-import cp /tmp/ss-import-database /var/www/bash/ss-import-database cp /tmp/ss-import-files /var/www/bash/ss-import-files cp /tmp/ss-install /var/www/bash/ss-install cp /tmp/ss-install-adminer /var/www/bash/ss-install-adminer cp /tmp/ss-install-clamav /var/www/bash/ss-install-clamav cp /tmp/ss-install-craft-config /var/www/bash/ss-install-craft-config cp /tmp/ss-install-craft-core /var/www/bash/ss-install-craft-core cp /tmp/ss-install-magento-config /var/www/bash/ss-install-magento-config cp /tmp/ss-install-magento-core /var/www/bash/ss-install-magento-core cp /tmp/ss-install-mediawiki-config /var/www/bash/ss-install-mediawiki-config cp /tmp/ss-install-mediawiki-core /var/www/bash/ss-install-mediawiki-core cp /tmp/ss-install-moodle-config /var/www/bash/ss-install-moodle-config cp /tmp/ss-install-moodle-core /var/www/bash/ss-install-moodle-core cp /tmp/ss-install-mysql /var/www/bash/ss-install-mysql cp /tmp/ss-install-nginx /var/www/bash/ss-install-nginx cp /tmp/ss-install-nginx-config /var/www/bash/ss-install-nginx-config cp /tmp/ss-install-nginx-core /var/www/bash/ss-install-nginx-core cp /tmp/ss-install-nginx-ssl /var/www/bash/ss-install-nginx-ssl cp /tmp/ss-install-nginx-openssl /var/www/bash/ss-install-nginx-openssl cp /tmp/ss-install-nginx-letsencrypt /var/www/bash/ss-install-nginx-letsencrypt cp /tmp/ss-install-opencart-config /var/www/bash/ss-install-opencart-config cp /tmp/ss-install-opencart-core /var/www/bash/ss-install-opencart-core cp /tmp/ss-install-php /var/www/bash/ss-install-php cp /tmp/ss-install-php-config /var/www/bash/ss-install-php-config cp /tmp/ss-install-php-core /var/www/bash/ss-install-php-core cp /tmp/ss-install-postfix /var/www/bash/ss-install-postfix cp /tmp/ss-install-prestashop-config /var/www/bash/ss-install-prestashop-config cp /tmp/ss-install-prestashop-core /var/www/bash/ss-install-prestashop-core cp /tmp/ss-install-redis /var/www/bash/ss-install-redis cp /tmp/ss-install-ubuntu-bash /var/www/bash/ss-install-ubuntu-bash cp /tmp/ss-install-ubuntu-crontab /var/www/bash/ss-install-ubuntu-crontab cp /tmp/ss-install-ubuntu-kernel /var/www/bash/ss-install-ubuntu-kernel cp /tmp/ss-install-ubuntu-ssh /var/www/bash/ss-install-ubuntu-ssh cp /tmp/ss-install-ubuntu-users /var/www/bash/ss-install-ubuntu-users cp /tmp/ss-install-ubuntu-utils /var/www/bash/ss-install-ubuntu-utils cp /tmp/ss-install-ufw /var/www/bash/ss-install-ufw cp /tmp/ss-install-ufw-config /var/www/bash/ss-install-ufw-config cp /tmp/ss-install-ufw-core /var/www/bash/ss-install-ufw-core cp /tmp/ss-install-wordpress-cli /var/www/bash/ss-install-wordpress-cli cp /tmp/ss-install-wordpress-config /var/www/bash/ss-install-wordpress-config cp /tmp/ss-install-wordpress-core /var/www/bash/ss-install-wordpress-core cp /tmp/ss-install-wordpress-mu-plugins /var/www/bash/ss-install-wordpress-mu-plugins cp /tmp/ss-maintenance-disable /var/www/bash/ss-maintenance-disable cp /tmp/ss-maintenance-enable /var/www/bash/ss-maintenance-enable cp /tmp/ss-monitor /var/www/bash/ss-monitor cp /tmp/ss-optimize-database /var/www/bash/ss-optimize-database cp /tmp/ss-overview /var/www/bash/ss-overview cp /tmp/ss-perms /var/www/bash/ss-perms cp /tmp/ss-perms-adminer /var/www/bash/ss-perms-adminer cp /tmp/ss-perms-clamav /var/www/bash/ss-perms-clamav cp /tmp/ss-perms-craft-config /var/www/bash/ss-perms-craft-config cp /tmp/ss-perms-craft-core /var/www/bash/ss-perms-craft-core cp /tmp/ss-perms-magento-config /var/www/bash/ss-perms-magento-config cp /tmp/ss-perms-magento-core /var/www/bash/ss-perms-magento-core cp /tmp/ss-perms-mediawiki-config /var/www/bash/ss-perms-mediawiki-config cp /tmp/ss-perms-mediawiki-core /var/www/bash/ss-perms-mediawiki-core cp /tmp/ss-perms-moodle-config /var/www/bash/ss-perms-moodle-config cp /tmp/ss-perms-moodle-core /var/www/bash/ss-perms-moodle-core cp /tmp/ss-perms-mysql /var/www/bash/ss-perms-mysql cp /tmp/ss-perms-nginx /var/www/bash/ss-perms-nginx cp /tmp/ss-perms-nginx-config /var/www/bash/ss-perms-nginx-config cp /tmp/ss-perms-nginx-core /var/www/bash/ss-perms-nginx-core cp /tmp/ss-perms-nginx-ssl /var/www/bash/ss-perms-nginx-ssl cp /tmp/ss-perms-nginx-openssl /var/www/bash/ss-perms-nginx-openssl cp /tmp/ss-perms-nginx-letsencrypt /var/www/bash/ss-perms-nginx-letsencrypt cp /tmp/ss-perms-opencart-config /var/www/bash/ss-perms-opencart-config cp /tmp/ss-perms-opencart-core /var/www/bash/ss-perms-opencart-core cp /tmp/ss-perms-php /var/www/bash/ss-perms-php cp /tmp/ss-perms-postfix /var/www/bash/ss-perms-postfix cp /tmp/ss-perms-prestashop-config /var/www/bash/ss-perms-prestashop-config cp /tmp/ss-perms-prestashop-core /var/www/bash/ss-perms-prestashop-core cp /tmp/ss-perms-redis /var/www/bash/ss-perms-redis cp /tmp/ss-perms-ubuntu-bash /var/www/bash/ss-perms-ubuntu-bash cp /tmp/ss-perms-ubuntu-crontab /var/www/bash/ss-perms-ubuntu-crontab cp /tmp/ss-perms-ubuntu-kernel /var/www/bash/ss-perms-ubuntu-kernel cp /tmp/ss-perms-ubuntu-ssh /var/www/bash/ss-perms-ubuntu-ssh cp /tmp/ss-perms-ubuntu-users /var/www/bash/ss-perms-ubuntu-users cp /tmp/ss-perms-ubuntu-utils /var/www/bash/ss-perms-ubuntu-utils cp /tmp/ss-perms-ufw /var/www/bash/ss-perms-ufw cp /tmp/ss-perms-wordpress-cli /var/www/bash/ss-perms-wordpress-cli cp /tmp/ss-perms-wordpress-config /var/www/bash/ss-perms-wordpress-config cp /tmp/ss-perms-wordpress-core /var/www/bash/ss-perms-wordpress-core cp /tmp/ss-perms-wordpress-mu-plugins /var/www/bash/ss-perms-wordpress-mu-plugins cp /tmp/ss-purge /var/www/bash/ss-purge cp /tmp/ss-purge-nginx /var/www/bash/ss-purge-nginx cp /tmp/ss-purge-opcache /var/www/bash/ss-purge-opcache cp /tmp/ss-purge-redis /var/www/bash/ss-purge-redis cp /tmp/ss-purge-transients /var/www/bash/ss-purge-transients cp /tmp/ss-reboot /var/www/bash/ss-reboot cp /tmp/ss-remote /var/www/bash/ss-remote cp /tmp/ss-reset-logs /var/www/bash/ss-reset-logs cp /tmp/ss-reset-password-sftp /var/www/bash/ss-reset-password-sftp cp /tmp/ss-restart-services /var/www/bash/ss-restart-services cp /tmp/ss-restart-services-nginx /var/www/bash/ss-restart-services-nginx cp /tmp/ss-restart-services-php /var/www/bash/ss-restart-services-php cp /tmp/ss-scan-malware /var/www/bash/ss-scan-malware cp /tmp/ss-sync-staging /var/www/bash/ss-sync-staging cp /tmp/ss-update /var/www/bash/ss-update cp /tmp/ss-update-config /var/www/bash/ss-update-config cp /tmp/ss-update-packages /var/www/bash/ss-update-packages cp /tmp/ss-worker /var/www/bash/ss-worker #################################################################################################### #### SS-Check: Reset Permissions (SS Core Cron Jobs) ############################################### #################################################################################################### ## SNIPPET: ss-check, ss-worker ## we hardcode this permissions reset snippet into ss core bash scripts for redundancy ## ## chmod 700 means only the root/sudo users can execute ss core cron jobs ## ## reset permissions ## chown root:root /var/www/crons/*cron* ## must be root:root chmod 0700 /var/www/crons/*cron* ## 0700 means root can execute #################################################################################################### #### SS-Check: Cleanup Temporary Files ############################################################# #################################################################################################### ## delete tmp files ## rm /tmp/ss* rm /tmp/*cron* #################################################################################################### #### SS-Check: Touch Timestamp File (End Script) ################################################### #################################################################################################### ## this is a dummy timestamp file that will remember the last time this script was run ## ## it can be useful for developer reference and is sometimes used by SlickStack ## ## script timestamp ## touch /var/www/meta/.timestamp-ss-check #################################################################################################### #### SlickStack: External References Used To Improve This Script (Thanks, Interwebz) ############### #################################################################################################### ## Ref: https://linuxize.com/post/bash-functions/ ## Ref: https://stackoverflow.com/questions/6366530/bash-syntax-error-unexpected-end-of-file ## SS_EOF