diff --git a/api/tacticalrmm/tacticalrmm/settings.py b/api/tacticalrmm/tacticalrmm/settings.py index c4247f3d..c0a92239 100644 --- a/api/tacticalrmm/tacticalrmm/settings.py +++ b/api/tacticalrmm/tacticalrmm/settings.py @@ -4,7 +4,7 @@ from pathlib import Path BASE_DIR = Path(__file__).resolve().parent.parent -SCRIPTS_DIR = "/community-scripts" +SCRIPTS_DIR = "/opt/trmm-community-scripts" DOCKER_BUILD = False diff --git a/install.sh b/install.sh index 05835f25..8327ddf2 100644 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/bin/bash -SCRIPT_VERSION="57" +SCRIPT_VERSION="58" SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/install.sh' sudo apt install -y curl wget dirmngr gnupg lsb-release @@ -11,6 +11,8 @@ BLUE='\033[0;34m' RED='\033[0;31m' NC='\033[0m' +SCRIPTS_DIR="/opt/trmm-community-scripts" + TMP_FILE=$(mktemp -p "" "rmminstall_XXXXXXXXXX") curl -s -L "${SCRIPT_URL}" > ${TMP_FILE} NEW_VER=$(grep "^SCRIPT_VERSION" "$TMP_FILE" | awk -F'[="]' '{print $3}') @@ -243,10 +245,10 @@ git config user.email "admin@example.com" git config user.name "Bob" git checkout master -sudo mkdir /community-scripts -sudo chown ${USER}:${USER} /community-scripts -git clone https://github.com/amidaware/community-scripts.git /community-scripts/ -cd /community-scripts +sudo mkdir -p ${SCRIPTS_DIR} +sudo chown ${USER}:${USER} ${SCRIPTS_DIR} +git clone https://github.com/amidaware/community-scripts.git ${SCRIPTS_DIR}/ +cd ${SCRIPTS_DIR} git config user.email "admin@example.com" git config user.name "Bob" git checkout main diff --git a/restore.sh b/restore.sh index b5f3851a..09861d8f 100755 --- a/restore.sh +++ b/restore.sh @@ -1,6 +1,6 @@ #!/bin/bash -SCRIPT_VERSION="32" +SCRIPT_VERSION="33" SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/restore.sh' sudo apt update @@ -12,6 +12,8 @@ BLUE='\033[0;34m' RED='\033[0;31m' NC='\033[0m' +SCRIPTS_DIR="/opt/trmm-community-scripts" + TMP_FILE=$(mktemp -p "" "rmmrestore_XXXXXXXXXX") curl -s -L "${SCRIPT_URL}" > ${TMP_FILE} NEW_VER=$(grep "^SCRIPT_VERSION" "$TMP_FILE" | awk -F'[="]' '{print $3}') @@ -218,10 +220,10 @@ git config user.email "admin@example.com" git config user.name "Bob" git checkout master -sudo mkdir /community-scripts -sudo chown ${USER}:${USER} /community-scripts -git clone https://github.com/amidaware/community-scripts.git /community-scripts/ -cd /community-scripts +sudo mkdir -p ${SCRIPTS_DIR} +sudo chown ${USER}:${USER} ${SCRIPTS_DIR} +git clone https://github.com/amidaware/community-scripts.git ${SCRIPTS_DIR}/ +cd ${SCRIPTS_DIR} git config user.email "admin@example.com" git config user.name "Bob" git checkout main diff --git a/update.sh b/update.sh index e5892891..fba4fe81 100644 --- a/update.sh +++ b/update.sh @@ -1,6 +1,6 @@ #!/bin/bash -SCRIPT_VERSION="128" +SCRIPT_VERSION="129" SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/update.sh' LATEST_SETTINGS_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/api/tacticalrmm/tacticalrmm/settings.py' YELLOW='\033[1;33m' @@ -9,6 +9,8 @@ RED='\033[0;31m' NC='\033[0m' THIS_SCRIPT=$(readlink -f "$0") +SCRIPTS_DIR="/opt/trmm-community-scripts" + TMP_FILE=$(mktemp -p "" "rmmupdate_XXXXXXXXXX") curl -s -L "${SCRIPT_URL}" > ${TMP_FILE} NEW_VER=$(grep "^SCRIPT_VERSION" "$TMP_FILE" | awk -F'[="]' '{print $3}') @@ -237,15 +239,15 @@ git clean -df git pull # update from community-scripts repo -if [[ ! -d /community-scripts ]]; then - sudo mkdir /community-scripts - sudo chown ${USER}:${USER} /community-scripts - git clone https://github.com/amidaware/community-scripts.git /community-scripts/ - cd /community-scripts +if [[ ! -d ${SCRIPTS_DIR} ]]; then + sudo mkdir -p ${SCRIPTS_DIR} + sudo chown ${USER}:${USER} ${SCRIPTS_DIR} + git clone https://github.com/amidaware/community-scripts.git ${SCRIPTS_DIR}/ + cd ${SCRIPTS_DIR} git config user.email "admin@example.com" git config user.name "Bob" else - cd /community-scripts + cd ${SCRIPTS_DIR} git config user.email "admin@example.com" git config user.name "Bob" git fetch @@ -260,7 +262,7 @@ WHEEL_VER=$(grep "^WHEEL_VER" "$SETTINGS_FILE" | awk -F'[= "]' '{print $5}') sudo chown ${USER}:${USER} -R /rmm -sudo chown ${USER}:${USER} -R /community-scripts +sudo chown ${USER}:${USER} -R ${SCRIPTS_DIR} sudo chown ${USER}:${USER} /var/log/celery sudo chown ${USER}:${USER} -R /etc/conf.d/ sudo chown -R $USER:$GROUP /home/${USER}/.npm