get.acme.sh icon indicating copy to clipboard operation
get.acme.sh copied to clipboard

Pass arguments to installOnline function

Open honzahommer opened this issue 5 years ago • 8 comments

This PR allows to pass arguments as referenced in in issue https://github.com/Neilpang/get.acme.sh/issues/2, related PR https://github.com/Neilpang/acme.sh/pull/2274.

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

honzahommer avatar May 19 '19 13:05 honzahommer

@Neilpang ping?

msva avatar Aug 01 '19 00:08 msva

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

msva avatar Aug 01 '19 00:08 msva

@msva Thanks, example updated.

honzahommer avatar Aug 01 '19 00:08 honzahommer

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.

msva avatar Aug 01 '19 00:08 msva

@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 ""

honzahommer avatar Aug 01 '19 01:08 honzahommer

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 :)

msva avatar Aug 01 '19 01:08 msva

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 :)

https://github.com/Neilpang/acme.sh/pull/2274/commits/f296fdd22bfcd86d70f17cd52d4712722b8669f4

honzahommer avatar Aug 01 '19 01:08 honzahommer

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

msva avatar Aug 01 '19 01:08 msva