Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
eb3bb297b9
|
|||
05660f568c
|
@ -20,7 +20,7 @@ Linted by [#ShellCheck](https://github.com/koalaman/shellcheck)
|
|||||||
---
|
---
|
||||||
# Install
|
# Install
|
||||||
```shell
|
```shell
|
||||||
$ sudo curl -L "https://git.vdm.dev/api/v1/repos/octoleo/octojoom/raw/src/octojoom" -o /usr/local/bin/octojoom
|
$ sudo curl -L "https://raw.githubusercontent.com/octoleo/octojoom/refs/heads/master/src/octojoom" -o /usr/local/bin/octojoom
|
||||||
$ sudo chmod +x /usr/local/bin/octojoom
|
$ sudo chmod +x /usr/local/bin/octojoom
|
||||||
```
|
```
|
||||||
|
|
||||||
|
23
src/octojoom
23
src/octojoom
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# The most recent program version.
|
# The most recent program version.
|
||||||
_VERSION="3.7.0"
|
_VERSION="3.7.1"
|
||||||
_V="3.7"
|
_V="3.7"
|
||||||
|
|
||||||
# Bash version required
|
# Bash version required
|
||||||
@ -2682,7 +2682,7 @@ function runUpdate() {
|
|||||||
# get the target branch to use in our update
|
# get the target branch to use in our update
|
||||||
isExpert && branch=$(getTargetBranch)
|
isExpert && branch=$(getTargetBranch)
|
||||||
# pull the latest version. Master is always the latest
|
# pull the latest version. Master is always the latest
|
||||||
if sudo curl --fail -L "https://git.vdm.dev/api/v1/repos/octoleo/octojoom/raw/src/octojoom?ref=${branch:-master}" -o /usr/local/bin/octojoom 2>/dev/null; then
|
if sudo curl --fail -L "https://raw.githubusercontent.com/octoleo/octojoom/refs/heads/${branch:-master}/src/octojoom" -o /usr/local/bin/octojoom 2>/dev/null; then
|
||||||
# give success message
|
# give success message
|
||||||
echo "SUCCESS: Update was successful."
|
echo "SUCCESS: Update was successful."
|
||||||
# do we have a backup
|
# do we have a backup
|
||||||
@ -3849,7 +3849,7 @@ function getImageSource() {
|
|||||||
local i=2
|
local i=2
|
||||||
# set the defaults
|
# set the defaults
|
||||||
default="joomla|https://hub.docker.com/_/joomla?tab=tags;https://raw.githubusercontent.com/joomla-docker/docker-joomla/master/docker-entrypoint.sh"
|
default="joomla|https://hub.docker.com/_/joomla?tab=tags;https://raw.githubusercontent.com/joomla-docker/docker-joomla/master/docker-entrypoint.sh"
|
||||||
default_octojoom="llewellyn/joomla|https://hub.docker.com/r/llewellyn/joomla/tags;https://git.vdm.dev/octoleo/docker-joomla/raw/branch/octoleo/docker-entrypoint.sh"
|
default_octojoom="llewellyn/joomla|https://hub.docker.com/r/llewellyn/joomla/tags;https://raw.githubusercontent.com/octoleo/docker-joomla/refs/heads/octoleo/docker-entrypoint.sh"
|
||||||
# we only ask if we are in expert mode
|
# we only ask if we are in expert mode
|
||||||
if isExpert; then
|
if isExpert; then
|
||||||
# set the base images source
|
# set the base images source
|
||||||
@ -5068,24 +5068,27 @@ function getMigrationType() {
|
|||||||
echo "${answer:-push}"
|
echo "${answer:-push}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check if the remote .env file exists
|
# Check if the remote .env file exists using the remote user's home directory
|
||||||
function remoteEnvFileExists() {
|
function remoteEnvFileExists() {
|
||||||
local remote_system="$1"
|
local remote_system="$1"
|
||||||
|
|
||||||
# Check if the file exists on the remote system
|
# The tilde (~) expands to the home directory of the logged-in remote user.
|
||||||
# shellcheck disable=SC2029
|
# Using single quotes ensures that the command is passed literally to the remote shell,
|
||||||
ssh "${remote_system}" "[ -f \"${VDM_HOME_PATH}/.config/octojoom/.env\" ]"
|
# allowing the tilde expansion to occur remotely.
|
||||||
|
ssh "${remote_system}" '[ -f ~/.config/octojoom/.env ]'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get a specific value from the remote .env file
|
# Get a specific value from the remote .env file using the remote user's home directory
|
||||||
function getRemoteEnvValue() {
|
function getRemoteEnvValue() {
|
||||||
local remote_system="$1"
|
local remote_system="$1"
|
||||||
local env_key="$2"
|
local env_key="$2"
|
||||||
local remote_env_value
|
local remote_env_value
|
||||||
|
|
||||||
if remoteEnvFileExists "${remote_system}"; then
|
if remoteEnvFileExists "${remote_system}"; then
|
||||||
# shellcheck disable=SC2029
|
# Execute the grep command on the remote system.
|
||||||
remote_env_value=$(ssh "${remote_system}" "grep '^${env_key}=' \"${VDM_HOME_PATH}/.config/octojoom/.env\"" | cut -d '=' -f 2-)
|
# The command uses \$HOME so that the remote shell expands it to the logged-in user's home directory.
|
||||||
|
# The env_key variable is expanded locally, while the file path remains intact for the remote shell.
|
||||||
|
remote_env_value=$(ssh "${remote_system}" "grep '^${env_key}=' \"\$HOME/.config/octojoom/.env\"" | cut -d '=' -f 2-)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove any double quotes from the returned value
|
# Remove any double quotes from the returned value
|
||||||
|
Reference in New Issue
Block a user