From acafa585f46202fc9991ee70e13f9743f918a450 Mon Sep 17 00:00:00 2001 From: neil Date: Mon, 9 May 2016 22:28:45 +0800 Subject: [PATCH] support tcsh --- acme.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/acme.sh b/acme.sh index e1662b04..190c9b51 100755 --- a/acme.sh +++ b/acme.sh @@ -1911,6 +1911,14 @@ _installalias() { _setopt "$_cshfile" "alias $PROJECT_ENTRY" " " "\"$LE_WORKING_DIR/$PROJECT_ENTRY\"" _setopt "$_csh_profile" "source \"$_cshfile\"" fi + + #for tcsh + _tcsh_profile="$HOME/.tcshrc" + if [ -f "$_tcsh_profile" ] ; then + _setopt "$_cshfile" "setenv LE_WORKING_DIR" " " "\"$LE_WORKING_DIR\"" + _setopt "$_cshfile" "alias $PROJECT_ENTRY" " " "\"$LE_WORKING_DIR/$PROJECT_ENTRY\"" + _setopt "$_tcsh_profile" "source \"$_cshfile\"" + fi } @@ -2019,6 +2027,12 @@ uninstall() { echo "$text" | sed "s|^.*\"$LE_WORKING_DIR/$PROJECT_NAME.csh\"$||" > "$_csh_profile" fi + _tcsh_profile="$HOME/.tcshrc" + if [ -f "$_tcsh_profile" ] ; then + text="$(cat $_tcsh_profile)" + echo "$text" | sed "s|^.*\"$LE_WORKING_DIR/$PROJECT_NAME.csh\"$||" > "$_tcsh_profile" + fi + rm -f $LE_WORKING_DIR/$PROJECT_ENTRY _info "The keys and certs are in $LE_WORKING_DIR, you can remove them by yourself."