feat(docker-compose.sh): add --install statement

This commit is contained in:
2025-07-31 15:11:06 +02:00
parent 6beeb2738b
commit 06ed6c5607
5 changed files with 37 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ if [[ "--install" == $INSTALLED ]]; then
create_env_variable "AWS" "$AWS_client"
read -p "Enter endpoint server (leave empty to not define it): " ENDPOINT_server
[[ ! -n $ENDPOINT_server ]] && create_env_variable "ENDPOINT" "$ENDPOINT_server"
[[ -n $ENDPOINT_server ]] && create_env_variable "ENDPOINT" "$ENDPOINT_server"
info_print "AWS configuration."
aws configure

View File

@@ -31,10 +31,10 @@ source /usr/local/bin/libs/notifications.sh
case "$PAM_TYPE" in
open_session)
PAYLOAD=" { \"text\": \"$PAM_USER logged in (remote host: $PAM_RHOST) at $(date).\" }"
PAYLOAD="$PAM_USER logged in (remote host: $PAM_RHOST) at $(date)."
;;
close_session)
PAYLOAD=" { \"text\": \"$PAM_USER logged out (remote host: $PAM_RHOST) at $(date).\" }"
PAYLOAD="$PAM_USER logged out (remote host: $PAM_RHOST) at $(date)."
;;
esac

View File

@@ -1,4 +1,18 @@
#!/bin/bash
INSTALLED=$1
if [[ "--install" == $INSTALLED ]]; then exit 0; fi
if [[ "--install" == $INSTALLED ]]; then
info_print "\n\
==================================================\n\
wireguard Installation\n\
--------------------------------------------------"
source /usr/local/bin/libs/common.sh
if [[ -f "$ETC_DIR/docker-compose.yml" ]]; then
docker compose up -d -f $ETC_DIR/docker-compose.yml && \
info_print "$ETC_DIR/docker-compose.yml is running." 2;
else info_print "no docker-compose.yml found at $ETC_DIR" 6;
fi
exit 0;
fi