#!/bin/bash #################################################################################################### #### author: SlickStack ############################################################################ #### link: https://slickstack.io ################################################################### #### mirror: https://mirrors.slickstack.io/bash/ss-install-ubuntu-utils.txt ######################## #### path: /var/www/ss-install-ubuntu-utils ######################################################## #### destination: n/a (not a boilerplate) ########################################################## #### purpose: Reinstalls the Ubuntu (OS) utilities for SlickStack servers (idempotent) ############# #### module version: Ubuntu 22.04 LTS ############################################################## #### sourced by: ss-install ######################################################################## #### bash aliases: ss install ubuntu utils, ss install utils ####################################### #################################################################################################### ## SS-CONFIG MUST BE PROPERLY CONFIGURED AND ON CURRENT BUILD BEFORE RUNNING SS-INSTALL ## ## ENSURE YOUR SS-CONFIG BUILD REMAINS CURRENT BY RUNNING SS-UPDATE OCCASIONALLY ## ## source ss-config ## source /var/www/ss-config ## source ss-functions ## source /var/www/ss-functions ## BELOW THIS RELIES ON SS-CONFIG AND SS-FUNCTIONS #################################################################################################### #### TABLE OF CONTENTS (SS-Install-Ubuntu-Utils) ################################################### #################################################################################################### ## this is a brief summary of the different code snippets you will find in this script ## ## each section should be commented so you understand what is being accomplished ## ## A. Touch Timestamp File ## B. Message (Begin Script) ## C. Prettify The Shell Prompt ## D. Update Existing Packages ## E. Update System Timezone #################################################################################################### #### A. SS-Install-Ubuntu-Utils: Touch Timestamp File ############################################## #################################################################################################### ## 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 ## ss_touch "${TIMESTAMP_SS_INSTALL_UBUNTU_UTILS}" #################################################################################################### #### B. SS-Install-Ubuntu-Utils: 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 ## ss_echo "${COLOR_INFO}Running ss-install-ubuntu-utils... ${COLOR_RESET}" #################################################################################################### #### C. SS-Install-Ubuntu-Utils: Prettify The Shell Prompt ######################################### #################################################################################################### ## download latest versions ## ss_wget /tmp/custom-shell-prompt "${MIRROR_CUSTOM_SHELL_PROMPT}" ## delete old one ## ss_rm /etc/profile.d/custom-shell-prompt ## copy files to their destinations ## ss_cp /tmp/custom-shell-prompt /etc/profile.d/custom-shell-prompt.sh #################################################################################################### #### D. SS-Install-Ubuntu-Utils: Update Existing Packages ########################################## #################################################################################################### ## SNIPPET: ss-install-*-packages bash scripts ## UPDATED: 30MAR2022 ## we must include the standard apt update/upgrade in case script is called directly ## ## this helps to avoid conflicts and outdated packages during installation ## ## update apt cache ## ss_apt_update ## upgrade packages ## ss_apt_upgrade #################################################################################################### #### E. SS-Install-Ubuntu-Utils: Update System Timezone ############################################ #################################################################################################### ## set default editor to nano ## update-alternatives --set editor /bin/nano ## set timezone ## if [[ -z "${SS_TIMEZONE}" ]]; then timedatectl set-timezone UTC else timedatectl set-timezone ${SS_TIMEZONE} fi #################################################################################################### #### SS-Install-Ubuntu-Utils: Install Various Linux Utilities ##################################### #################################################################################################### ## install update-manager-core ## ss_apt_install update-manager-core ## install Linux utilities (Zip, Unzip, DOS2Unix) ## ss_apt_install zip ss_apt_install unzip ss_apt_install dos2unix ss_apt_install gzip ss_apt_install tar ## install rsync (some cloud networks apparently remove it from Ubuntu ISO for some reason as per GitHub issues) ## ss_apt_install rsync ## install Git ## ss_apt_install git ## magento ## ss_apt_install bash ss_apt_install curl ss_apt_install software-properties-common ss_apt_install openssl ss_apt_install sed ## install debconf-utils for some APT debug tools (move this to ss-install-misc) ## ss_apt_install debconf-utils ## virt-what ## ss_apt_install virt-what ## exiftool ## ss_apt_install "${PACKAGE_EXIFTOOL}" ## sshpass ## ss_apt_install sshpass #################################################################################################### #### SS-Install-Ubuntu-Utils: Reset Permissions (Ubuntu Utils) ##################################### #################################################################################################### ## run ss-perms-ubuntu-utils ## source "${PATH_SS_PERMS_UBUNTU_UTILS}" #################################################################################################### #### PLACEHOLDER: Reset Permissions (SlickStack Scripts) ########################################### #################################################################################################### ## we include this permissions reset in all cron jobs and bash scripts for redundancy ## ## chmod 0700 means only the root/sudo users can execute any SlickStack scripts ## ## THIS SNIPPET DOES NOT RELY ON SS-CONFIG OR SS-FUNCTIONS ## SNIPPET: ss bash scripts, ss cron jobs ## UPDATED: 02JUL2022 chown root:root /var/www/ss* ## must be root:root chown root:root /var/www/crons/*cron* ## must be root:root chown root:root /var/www/crons/custom/*cron* ## must be root:root chmod 0700 /var/www/ss* ## 0700 means only root/sudo can execute chmod 0700 /var/www/crons/*cron* ## 0700 means only root/sudo can execute chmod 0700 /var/www/crons/custom/*cron* ## 0700 means only root/sudo can execute #################################################################################################### #### SlickStack: External References Used To Improve This Script (Thanks, Interwebz) ############### #################################################################################################### ## Ref: https://github.com/littlebizzy/slickstack/issues/77 ## Ref: https://help.ubuntu.com/community/rsync ## Ref: http://people.redhat.com/~rjones/virt-what/ ## Ref: https://unix.stackexchange.com/questions/89714/easy-way-to-determine-virtualization-technology ## Ref: https://linuxnightly.com/how-to-remove-exif-data-via-linux-command-line/ ## Ref: https://linuxpip.org/install-rclone/ ## Ref: http://manpages.ubuntu.com/manpages/cosmic/man1/rclone.1.html ## Ref: https://help.backblaze.com/hc/en-us/articles/1260804565710-How-to-use-rclone-with-Backblaze-B2-Cloud-Storage ## Ref: https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html ## Ref: https://github.com/frdmn/minebackup.sh/issues/5 ## Ref: https://howtoinstall.co/en/nice ## Ref: https://askubuntu.com/questions/733169/how-to-install-libxml2-in-ubuntu-15-10 ## Ref: https://stackoverflow.com/questions/41887754/why-apt-get-install-openssl-did-not-install-last-version-of-openssl ## SS_EOF