Skip to content

Pass arguments to installOnline function#5

Open
honzahommer wants to merge 7 commits into
acmesh-official:masterfrom
honzahommer:master
Open

Pass arguments to installOnline function#5
honzahommer wants to merge 7 commits into
acmesh-official:masterfrom
honzahommer:master

Conversation

@honzahommer

@honzahommer honzahommer commented May 19, 2019

Copy link
Copy Markdown

This PR allows to pass arguments as referenced in in issue #2, related PR acmesh-official/acme.sh#2274.

wget -O- ... | sh -s -- --home /some/dir  --noprofile --nocron

@msva

msva commented Aug 1, 2019

Copy link
Copy Markdown

@neilpang ping?

@msva

msva commented Aug 1, 2019

Copy link
Copy Markdown

btw, @honzahommer
original issue (#2) mentions -- (double hyphen) and not - (single) as separator between "-s" and options that should be passed to the script

@honzahommer

Copy link
Copy Markdown
Author

@msva Thanks, example updated.

@msva

msva commented Aug 1, 2019

Copy link
Copy Markdown

and, btw, adding possiblity to not install cron/profile based on env variables would be great too.

I think it will be even enough to just:

@@ -5715,9 +5715,9 @@ install() {
     LE_WORKING_DIR="$DEFAULT_INSTALL_HOME"
   fi

-  _nocron="$1"
+  _nocron="${NO_CRON:-$1}"
   _c_home="$2"
-  _noprofile="$3"
+  _noprofile="${NO_PROFILE:-$3}"
   if ! _initpath; then
     _err "Install failed."
     return 1

as minimum.

@honzahommer

Copy link
Copy Markdown
Author

@msva It's good idea, thanks. Actually there is possibility to do this:

wget ... | sh -s nocron noprofile
wget ... | sh -s "" noprofile
wget ... | sh -s nocron ""

@msva

msva commented Aug 1, 2019

Copy link
Copy Markdown

I actually meant that case:

export NO_CRON=1 NO_PROFILE=1
$fetcher_cmd ... | sh

// actually, my real case is having them in my shell-rc-file, so that acme.sh will never touch either:

  • my ~/.zshrc (that is symlinked to the git repo with my dorfiles that I deploy on many machines)
  • or crontab (for whatever reasons I don't want it to touch it)

irrelevant if I forgot to pass parameters on that exact machine :)

@honzahommer

Copy link
Copy Markdown
Author

I actually meant that case:

export NO_CRON=1 NO_PROFILE=1
$fetcher_cmd ... | sh

// actually, my real case is having them in my shell-rc-file, so that acme.sh will never touch either:

  • my ~/.zshrc (that is symlinked to the git repo with my dorfiles that I deploy on many machines)
  • or crontab (for whatever reasons I don't want it to touch it)

irrelevant if I forgot to pass parameters on that exact machine :)

acmesh-official/acme.sh@f296fdd

@msva

msva commented Aug 1, 2019

Copy link
Copy Markdown

Yeah, that PR would be right place to discuss that. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants