mirror of
https://github.com/msfjarvis/server-config
synced 2025-08-14 14:07:02 +05:30
Reformat with 2 space indent
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
7953399bb8
commit
89a61329ba
2 changed files with 86 additions and 86 deletions
|
@ -3,8 +3,8 @@
|
|||
CL_RST="\033[0m"
|
||||
CL_YLW="\033[01;33m"
|
||||
|
||||
function prettyPrint {
|
||||
echo -e "${CL_YLW}${1}${CL_RST}"
|
||||
function prettyPrint() {
|
||||
echo -e "${CL_YLW}${1}${CL_RST}"
|
||||
}
|
||||
|
||||
# Grab all service names
|
||||
|
@ -12,20 +12,20 @@ declare -a services=('caddy' 'goaccess' 'mirror-bot' 'mirror-bot-2' 'mkr-bin' 'u
|
|||
|
||||
# Now loop through each service and install it
|
||||
for service in "${services[@]}"; do
|
||||
if [ "${1}" ] && [[ "${service}" != "${1}" && "${service}.service" != "${1}" ]]; then
|
||||
continue
|
||||
fi
|
||||
prettyPrint "Checking root access"
|
||||
sudo -v || return 1
|
||||
prettyPrint "Installing ${service}"
|
||||
sudo cp -v "${service}.service" /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
if [ -z "${NO_RESTART}" ]; then
|
||||
prettyPrint "Restarting ${service}"
|
||||
sudo systemctl restart "${service}"
|
||||
if [ ! -f "/etc/systemd/system/multi-user.target.wants/${service}.service" ]; then
|
||||
prettyPrint "Enabling ${service}"
|
||||
sudo systemctl enable "${service}"
|
||||
fi
|
||||
if [ "${1}" ] && [[ ${service} != "${1}" && "${service}.service" != "${1}" ]]; then
|
||||
continue
|
||||
fi
|
||||
prettyPrint "Checking root access"
|
||||
sudo -v || return 1
|
||||
prettyPrint "Installing ${service}"
|
||||
sudo cp -v "${service}.service" /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
if [ -z "${NO_RESTART}" ]; then
|
||||
prettyPrint "Restarting ${service}"
|
||||
sudo systemctl restart "${service}"
|
||||
if [ ! -f "/etc/systemd/system/multi-user.target.wants/${service}.service" ]; then
|
||||
prettyPrint "Enabling ${service}"
|
||||
sudo systemctl enable "${service}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue