mirror of
https://github.com/winapps-org/winapps.git
synced 2025-06-02 13:17:19 +02:00
Minor optimisations to 'waCheckContainerRunning'.
This commit is contained in:
parent
25b241b12d
commit
ba86f338bf
37
installer.sh
37
installer.sh
@ -72,16 +72,17 @@ readonly INQUIRER_PATH="./install/inquirer.sh" # UNIX path to the 'inquirer' scr
|
||||
readonly VM_NAME="RDPWindows" # Name of the Windows VM (FOR 'libvirt' ONLY).
|
||||
readonly RDP_PORT=3389 # Port used for RDP on Windows.
|
||||
readonly DOCKER_IP="127.0.0.1" # Localhost.
|
||||
RDP_USER=""
|
||||
RDP_PASS=""
|
||||
#RDP_DOMAIN="MYDOMAIN"
|
||||
#RDP_IP="192.168.123.111"
|
||||
#WAFLAVOR="docker" # Acceptable values are 'docker', 'podman' and 'libvirt'.
|
||||
readonly WINAPPS_CONFIG="\
|
||||
RDP_USER=\"MyWindowsUser\"
|
||||
RDP_PASS=\"MyWindowsPassword\"
|
||||
#RDP_DOMAIN=\"MYDOMAIN\"
|
||||
#RDP_IP=\"192.168.123.111\"
|
||||
#WAFLAVOR=\"docker\" # Acceptable values are 'docker', 'podman' and 'libvirt'.
|
||||
#RDP_SCALE=100 # Acceptable values are 100, 140, and 180.
|
||||
#RDP_FLAGS=""
|
||||
#MULTIMON="true"
|
||||
#DEBUG="true"
|
||||
#FREERDP_COMMAND="xfreerdp"' # Default WinApps configuration file content.
|
||||
#RDP_FLAGS=\"\"
|
||||
#MULTIMON=\"true\"
|
||||
#DEBUG=\"true\"
|
||||
#FREERDP_COMMAND=\"xfreerdp\""
|
||||
|
||||
### GLOBAL VARIABLES ###
|
||||
# USER INPUT
|
||||
@ -807,16 +808,19 @@ function waCheckContainerRunning() {
|
||||
|
||||
# Declare variables.
|
||||
local CONTAINER_STATE=""
|
||||
local COMPOSE_COMMAND=""
|
||||
|
||||
if [[ "$WAFLAVOR" == "docker" ]]; then
|
||||
CONTAINER_STATE=$(docker ps --filter name="WinApps" --format '{{.Status}}')
|
||||
elif [[ "$WAFLAVOR" == "podman" ]]; then
|
||||
CONTAINER_STATE=$(podman ps --filter name="WinApps" --format '{{.Status}}')
|
||||
fi
|
||||
|
||||
# Determine the state of the container.
|
||||
CONTAINER_STATE=$("$WAFLAVOR" ps --all --filter name="WinApps" --format '{{.Status}}')
|
||||
CONTAINER_STATE=${CONTAINER_STATE,,} # Convert the string to lowercase.
|
||||
CONTAINER_STATE=${CONTAINER_STATE%% *} # Extract the first word.
|
||||
|
||||
# Determine the compose command.
|
||||
case "$WAFLAVOR" in
|
||||
"docker") COMPOSE_COMMAND="docker compose" ;;
|
||||
"podman") COMPOSE_COMMAND="podman-compose" ;;
|
||||
esac
|
||||
|
||||
# Check container state.
|
||||
if [[ "$CONTAINER_STATE" != "up" ]]; then
|
||||
# Complete the previous line.
|
||||
@ -831,8 +835,7 @@ function waCheckContainerRunning() {
|
||||
# Display the suggested action(s).
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo "Please ensure Windows is powered on:"
|
||||
echo -e "${COMMAND_TEXT}docker compose --file ~/.config/winapps/winapps.conf start${CLEAR_TEXT} # Docker"
|
||||
echo -e "${COMMAND_TEXT}podman-compose --file ~/.config/winapps/winapps.conf start${CLEAR_TEXT} # Podman"
|
||||
echo -e "${COMMAND_TEXT}${COMPOSE_COMMAND} --file ~/.config/winapps/winapps.conf start${CLEAR_TEXT}"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
|
||||
# Terminate the script.
|
||||
|
Loading…
x
Reference in New Issue
Block a user