msoap / shell2http

Executing shell commands via HTTP server
MIT License
1.34k stars 132 forks source link

quotes are messed up #64

Closed stanislavrudenko-okta closed 3 years ago

stanislavrudenko-okta commented 4 years ago

Hi,

I have a script that fails and that's ok, I'm getting following:

/bin/mkdir: cannot create directory ‘/a/b/c’: No such file or directory
/bin/ln: failed to create symbolic link ‘/c/b’ -> ‘’: No such file or directory
/bin/ln: failed to create symbolic link ‘/c/b’ -> ‘’: No such file or directory

The issue in here are quotes... instead of ASCII shell2http returns unicode's quote (U+2019) what is wrong

Is there any quick fix for this?

msoap commented 4 years ago

Hi, could you please provide this script? And how did you install the utility (maybe via snap)?

stanislavrudenko-okta commented 3 years ago

hey @msoap, sorry for the late response To install it pretty much I just do the following with configuration tool

curl --silent --show-error --insecure --location --fail "https://github.com/msoap/shell2http/releases/download/1.13/shell2http-1.13.linux.amd64.tar.gz" --output shell2http.tar.gz

The script itself:

#!/usr/bin/env bash
export TERM="xterm-256color"
yumRepoBase="/opt/yum"
qaRelease="${yumRepoBase}/repo/qarelease-internal-eng"
prodRelease="${yumRepoBase}/repo/release"
yumQaRepoDir="${yumRepoBase}/qa/8.2/x86_64"

exit_error() {
  echo "===> $(tput bold)$(tput setaf 1)Error:$(tput sgr0) ${1}"
  exit 1
}

update_link() {
  link="${1}"
  file="${2}"
  /bin/rm -f "${link}"
  /bin/ln -s "${file}" "${link}"
}

[[ -z $v_environment ]] && exit_error "Set your environment"

if [[ -e ${yumQaRepoDir}/Packages/current ]]; then
    currentVersion=$(basename "$(readlink "${yumQaRepoDir}/Packages/current")")
else
    echo "Current version not found. Exiting"
    exit 1
fi

case $v_environment in
  prod)
    releasePackage=$(/bin/ls "${yumRepoBase}/${v_environment}/${currentVersion}/release"*)
    update_link "${prodRelease}" "${releasePackage}"
  ;;
  qa)
    releasePackage=$(/bin/ls "${yumRepoBase}/${v_environment}/${currentVersion}/qarelease"*)
    update_link "${qaRelease}" "${releasePackage}"
  ;;
esac
msoap commented 3 years ago

It's something with your shell or environment, shell2http itself does not change the script output in any way. See:

Screenshot 2020-12-20 at 16 01 49

Maybe you can provide a minimal example of script and startup line of shell2http?

stanislavrudenko-okta commented 3 years ago

Hey @msoap, I was not able to reproduce this in docker container so wondering if this is something related to my script. I'm going to close this, will perform further testing later and if I'll find a way to reproduce it and prove it's related to shell2http I'll re-open the issue.

Thanks!