Compare commits

...

3 Commits

View File

@ -8,8 +8,6 @@ REPO="babbarc/workspaces"
BRANCH="master"
URL="$PROTOCOL://$HOST/$REPO/raw/branch/$BRANCH"
ALLOWED_PATH="/home/infilytics/home.tar.gz"
LOG_FILE="/tmp/.gitops-router-${PERSON}.log"
log() {
@ -18,18 +16,7 @@ log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [$level] $*" | tee -a "$LOG_FILE"
}
logO() {
local level="${1^^}" # convert to uppercase
shift
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [$level] $*" >>"$LOG_FILE"
}
logO info "Received SSH_ORIGINAL_COMMAND: $SSH_ORIGINAL_COMMAND"
if [[ "${SSH_ORIGINAL_COMMAND:-}" == "scp -t $ALLOWED_PATH" ]]; then
exec scp -t "ALLOWED_PATH"
exit
fi
log info "Received SSH_ORIGINAL_COMMAND: $SSH_ORIGINAL_COMMAND"
# Ensure the variable is set
if [[ -z "${SSH_ORIGINAL_COMMAND:-}" ]]; then
@ -98,8 +85,8 @@ clean)
status)
podman images
;;
scp)
log error "Invalid scp upload path: $args"
remove)
podman rm "$args"
;;
*)
log error "Unknown command: $command"