同步操作将从 httpsok/httpsok 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/bin/env bash# WIKI: https://fposter.cn/doc# This script only supports bash, do not support posix sh.# If you have the problem like Syntax error: "(" unexpected (expecting "fi"),# Try to run "bash -version" to check the version.# Try to visit WIKI to find a solution.VER=1.8.2PROJECT_NAME="httpsok"PROJECT_ENTRY="httpsok.sh"PROJECT_HOME="$HOME/.httpsok"PROJECT_ENTRY_BIN="$PROJECT_HOME/$PROJECT_ENTRY"PROJECT_TOKEN_FILE="$PROJECT_HOME/token"PROJECT_LOG_FILE="$PROJECT_HOME/$PROJECT_NAME.log"HTTPSOK_TOKEN=""HTTPSOK_HOME_URL="https://fposter.cn/"BASE_API_URL="https://fposter.cn/v1/nginx"SCRIPT_URL="https://fposter.cn/httpsok.sh"latest_code=""preparse=""OS=""NGINX_VERSION=""NGINX_CONFIG=""NGINX_CONFIG_HOME=""TRACE_ID=""MODE="normal"_upper_case() {tr '[a-z]' '[A-Z]'}_lower_case() {tr '[A-Z]' '[a-z]'}_startswith() {_str="1ドル"_sub="2ドル"echo "$_str" | grep -- "^$_sub" >/dev/null 2>&1}_endswith() {_str="1ドル"_sub="2ドル"echo "$_str" | grep -- "$_sub\$" >/dev/null 2>&1}_contains() {_str="1ドル"_sub="2ドル"echo "$_str" | grep -- "$_sub" >/dev/null 2>&1}_time() {date -u "+%s"}_math() {_m_opts="$@"printf "%s" "$(($_m_opts))"}_err() {echo -e "0円33[31m$(date +"%F %T")$@0円33[0m" 1>&2}_info() {echo -e "$(date +"%F %T")$@" 1>&2}_suc() {echo -e "0円33[32m$(date +"%F %T")$@0円33[0m" 1>&2}_random_md5() {head -c 32 /dev/urandom | md5sum | awk '{print 1ドル}'}TRACE_ID=$(_random_md5)_exists() {cmd="1ドル"if [ -z "$cmd" ]; then_usage "Usage: _exists cmd"return 1fiif eval type type >/dev/null 2>&1; theneval type "$cmd" >/dev/null 2>&1elif command >/dev/null 2>&1; thencommand -v "$cmd" >/dev/null 2>&1elsewhich "$cmd" >/dev/null 2>&1firet="$?"return $ret}showWelcome() {echoecho -e "0円33[1;36mHttpsok make SSL easy. $HTTPSOK_HOME_URL0円33[0m"echo -e "0円33[1;36mversion: $VER0円33[0m"echo -e "0円33[1;36mTraceID: $TRACE_ID0円33[0m"# echo "home: $PROJECT_HOME"echo}_mkdirs() {_dir="1ドル"if [ ! "$_dir" = "" ]; thenif [ ! -d "$_dir" ]; thenmkdir -p "$_dir" && _suc "Create directory $_dir success."fifi}_initpath() {_mkdirs "$PROJECT_HOME"}_no_nginx_here(){echo_err "Can’t detected nginx\n"_err "Please confirm that nginx has been successfully installed on your system"echoechoexit}_initparams() {if [ "$OS" != "" ]; thenreturn 0fiif [ -f /etc/os-release ]; then# source /etc/os-release# OS=$PRETTY_NAMEOS=$(grep 'PRETTY_NAME' /etc/os-release | awk -F '=' '{print 2ドル}' | tr -d '"')elif [ -f /etc/redhat-release ]; thenOS=$(cat /etc/redhat-release)elif [ -f /etc/alpine-release ]; thenOS="alpine"else_err "Unsupported operating system"exit 1finginx_bin=nginx$nginx_bin -V > /dev/null 2>&1if [ $? -ne 0 ]; thenecho "no nginx in PATH, find the nginx"pid=$(ps -e | grep nginx | grep -v 'grep' | head -n 1 | awk '{print 1ドル}')if [ -n "$pid" ]; thennginx_bin=$(readlink -f /proc/"$pid"/exe)# echo "nginx_bin=$nginx_bin"# again to verify$nginx_bin -V > /dev/null 2>&1if [ $? -ne 0 ]; then_no_nginx_hereelseecho "Nginx executable path: $nginx_bin"fielse_no_nginx_herefifiNGINX_VERSION=$($nginx_bin -v 2>&1 | awk -F ': ' '{print 2ドル}' | head -c 20)# Use a running nginx firstNGINX_CONFIG=$(ps -eo pid,cmd | grep nginx | grep master | grep '\-c' | awk -F '-c' '{print 2ドル}' | sed 's/ //g')if [ -z "$NGINX_CONFIG" ]; thenNGINX_CONFIG=$($nginx_bin -t 2>&1 | grep 'configuration' | head -n 1 | awk -F 'file' '{print 2ドル}' | awk '{print 1ドル}' )fiNGINX_CONFIG_HOME=$(dirname "$NGINX_CONFIG")_info "os-name: $OS"_info "version: $NGINX_VERSION"_info "nginx-config: $NGINX_CONFIG"_info "nginx-config-home: $NGINX_CONFIG_HOME"showWelcome}_inithttp() {_H0="Content-Type: text/plain"_H1="httpsok-token: $HTTPSOK_TOKEN"_H2="httpsok-version: $VER"_H3="os-name: $OS"_H4="nginx-version: $NGINX_VERSION"_H5="nginx-config-home: $NGINX_CONFIG_HOME"_H6="nginx-config: $NGINX_CONFIG"_H7="trace-id: $TRACE_ID"_H8="mode: $MODE"}_post() {_inithttpurl="${BASE_API_URL}1ドル"body="2ドル"curl -s -X POST -H "$_H0" -H "$_H1" -H "$_H2" -H "$_H3" -H "$_H4" -H "$_H5" -H "$_H6" -H "$_H7" -H "$_H8" --data-binary "$body" "$url"}_post2() {_inithttpurl="${BASE_API_URL}1ドル"fiename="2ドル"curl -s -X POST -H "$_H0" -H "$_H1" -H "$_H2" -H "$_H3" -H "$_H4" -H "$_H5" -H "$_H6" -H "$_H7" -H "$_H8" --data-binary "@$fiename" "$url"}_get() {_inithttpurl="${BASE_API_URL}1ドル"curl -s -H "$_H0" -H "$_H1" -H "$_H2" -H "$_H3" -H "$_H4" -H "$_H5" -H "$_H6" -H "$_H7" -H "$_H8" "$url"}_upload() {_inithttpurl="${BASE_API_URL}/upload?code=1ドル"_F1="cert=@\"2ドル\""_F2="certKey=@\"3ドル\""curl -s -X POST -H "Content-Type: multipart/form-data" -H "$_H1" -H "$_H2" -H "$_H3" -H "$_H4" -H "$_H5" -H "$_H6" -H "$_H7" -H "$_H8" -F $_F1 -F $_F2 "$url" 2>&1}_put() {_inithttpurl="${BASE_API_URL}1ドル"body="2ドル"curl -s -X PUT -H "$_H0" -H "$_H1" -H "$_H2" -H "$_H3" -H "$_H4" -H "$_H5" -H "$_H6" -H "$_H7" -H "$_H8" --data-binary "$body" "$url"}_remote_log() {type="1ドル"code="2ドル"msg="3ドル"_put "/log/$type?code=$code" "$msg"}_create_file() {local file_path="1ドル"if [ ! -e "$file_path" ]; thendir_path=$(dirname "$file_path")mkdir -p "$dir_path"touch "$file_path"_info "File created: $file_path"fi}_check() {depth=1ドルcode=2ドルcert_file=3ドルcert_key_file=4ドルurl="/check?code=$code"if [ $depth -le 0 ]; then_err "The maximum number of attempts exceeded"elseresp=$(_get "$url")status=$(echo "$resp" | head -n 1)case $status in"1")_suc "$code$cert_file The new certificate has been updated"md5_line=$(echo "$resp" | awk 'NR==2')cert_file_md5=$(echo $md5_line | awk -F ',' '{print 1ドル}')cert_key_file_md5=$(echo $md5_line | awk -F ',' '{print 2ドル}')tmp_cert_file="/tmp/$code.cer"tmp_cert_key_file="/tmp/$code.key"_get "/cert/$code.cer" > "$tmp_cert_file" && _get "/cert/$code.key" > "$tmp_cert_key_file"# md5 checktmp_cert_md5=$(md5sum "$tmp_cert_file" | awk '{print 1ドル}')tmp_cert_key_md5=$(md5sum "$tmp_cert_key_file" | awk '{print 1ドル}')if [ "$cert_file_md5" = "$tmp_cert_md5" ] && [ "$cert_key_file_md5" = "$tmp_cert_key_md5" ]; then# if local_cert_file not here. need to create the file_create_file "$cert_file" && _create_file "$cert_key_file"mv "$tmp_cert_file" "$cert_file" && mv "$tmp_cert_key_file" "$cert_key_file"_suc "$code$cert_file New cert updated"_remote_log "cert-updated-success" "$code" "New cert updated"echo "latest_code $code"else_err "$code$cert_file New cert update failed (md5 not match)"_remote_log "cert-updated-failed" "$code" "New cert update failed (md5 not match): cert_file_md5=$cert_file_md5,tmp_cert_md5=$tmp_cert_md5,cert_key_file_md5=$cert_key_file_md5,tmp_cert_key_md5=$tmp_cert_key_md5"fi;;"2")_info "$code$cert_file Processing, please just wait..."sleep 10_check $((depth - 1)) "$code" "$cert_file" "$cert_key_file";;"3")_suc "$code$cert_file Cert valid";;"12")_err "$code$cert_file DNS CNAME invalid";;"13")_err "$code$cert_file code invalid";;*)_err "$code$cert_file$resp";;esacfi}_save_token() {_token="1ドル"_check_token "$_token"_initpathif [ ! "$_token" = "" ]; thenecho "$_token" > "$PROJECT_TOKEN_FILE"_suc "save token $_token to $PROJECT_TOKEN_FILE"fi}_load_token() {if [ "$HTTPSOK_TOKEN" = "" ]; thenHTTPSOK_TOKEN=$(cat "$PROJECT_TOKEN_FILE")fi}_show_token() {_load_tokenecho -e "Your token is: 0円33[1;36m$HTTPSOK_TOKEN0円33[0m"}_check_token() {_token="1ドル"if [ ! "$_token" = "" ]; thenHTTPSOK_TOKEN="$_token"fiif [ "$HTTPSOK_TOKEN" = "" ]; then_err "httpsok's token can not empty"exit 4fistatus=$(_get "/status")# _info "status >> $status"if [ "$status" != "ok" ]; then# echo -e "033円[1;36mTraceID: $TRACE_ID033円[0m"_err "Invalid token: 0円33[1;36m$HTTPSOK_TOKEN0円33[0m"_info "Please copy your token from '$HTTPSOK_HOME_URL'"echoexit 4fireturn 0}# Limit the maximum nesting level_include_max_calls=5_include_global_count=0__process_include() {# echo "-_include_global_count: $_include_global_count --------------------------------------------------"# echo Recursive call, degree incremented by one((_include_global_count++))if [ $_include_global_count -gt $_include_max_calls ]; thenecho "#######################################################"echo "##### warning: Maximum recursion limit reached."echo "#######################################################"cat /dev/stdinreturn 0fitmp=$(cat /dev/stdin | awk -v NGINX_CONFIG=">$NGINX_CONFIG:" -v NGINX_CONFIG_HOME="$NGINX_CONFIG_HOME" '{original = 0ドル# Remove leading and trailing whitespace characters from each linegsub(/^[[:space:]]+|[[:space:]]+$/, "")sub(/^[\t ]*|[\t ]*$/,"")# Ignore the lines at the beginning of the fileif (0ドル ~ /^>/) {print originalnext}# Determines if it starts with #, and if it does, ignores itif (0ドル ~ /^#/) {# Replace the include in the comment# gsub("include", "import")print originalnext}# Determine whether include is includedif (0ドル ~ /^include /) {# Ignore mime.typesif(0ドル ~ /mime\.types;/){print "#import " originalnext}# print "#import " 2ドルprint "#import " original# system("cat " 2ドル)# print ">> "# ls /etc/nginx/conf.d/*.conf | xargs -I {} sed "s|^|{}:|" {}# system("ls " 2ドル " | xargs -I {} sed \"s|^|{}:|\" {}")# /etc/nginx/conf.d/*.conf;# Replace ;gsub(/;/, "")# /etc/nginx/conf.d/*.conf# Resolved to an include file# print 2ドル# Deal with relative path issuesif (substr(2,ドル 1, 1) != "/") {2ドル = NGINX_CONFIG_HOME "/" 2ドル}# print "# " original# The second way# find . -maxdepth 1 -print0 | xargs -0 command# system("find " 2ドル " -maxdepth 1 -print0 | xargs -0 -I {} sed \"s|^|>{}:|\" {}")# just backup# system("ls -1 " 2ドル " | xargs -I {} sed \"s|^|>{}:|\" {}")# If the last line of the file is not newline, the file will not be parsed correctly# system("ls -1 " 2ドル " 2>/dev/null | xargs -I {} cat {} ")# Using sh has security implications deprecated# system("ls -1 " 2ドル " 2>/dev/null | xargs -I {} sh -c \"cat {} && echo\" ")## system("ls -1 " 2ドル " 2>/dev/null | xargs -I {} sed -n \"$p\" {} ")# xargs -I {} awk -v FP="{}" "BEGIN{ print \"# include \" FP } {print} END{print ""} " {}#system("ls -1 " 2ドル " 2>/dev/null | xargs -I {} awk \" {print} END {print \"\" } \" {} ")## cmd = "ls -1 " 2ドル " 2>/dev/null | xargs -I {} awk \" {print} END {print \"\\\"\"\n\"\\\"\" } \" {} "# cmd = "ls -1 " 2ドル " 2>/dev/null | xargs -I {} awk \"BEGIN {print \"\"{}\"\" } {print} END {print \n } \" {} "# OK Add a newline character to the end of the file# cmd = "ls -1 " 2ドル " 2>/dev/null | xargs -I {} awk \" {print} END {print \"\\n\" } \" {} "# OK Add a newline character to the end of the file# cmd = "ls -1 " 2ドル " 2>/dev/null | xargs -I {} awk '\'' {print} '\'' {} "# OK add config file path#cmd = "ls -1 " 2ドル " 2>/dev/null | xargs -I GG awk '\'' BEGIN {print \"#included GG;\" } {print} '\'' GG "#cmd = "ls -1 " 2ドル " 2>/dev/null | xargs -I {} awk '\'' BEGIN {print \"#included {};\" } {print} '\'' {} "cmd = "ls -1 " 2ドル " 2>/dev/null | xargs -I {} awk '\'' BEGIN {print \"#included-begin {};\" } {print} END{ print \"#included-end {};\" } '\'' {} "# print cmdsystem(cmd)print ""next}print original}')if echo "$tmp" | grep -v '#' | grep -q "include"; then# Perform a recursive callecho "$tmp" | __process_includeelse# End the recursive callecho "$tmp"fi}# __process_format(){# cat /dev/stdin | awk -v NGINX_CONFIG="$NGINX_CONFIG:" '{# # gsub("import", "include")# # print NGINX_CONFIG 0ドル# print 0ドル# }'# }_preparse() {_initparamsconfig_text=$(cat $NGINX_CONFIG | __process_include )tmp_name="/tmp/2nLN3ZspTMGifYtO.tmp"echo "$config_text" > $tmp_namepreparse=$(_post2 "/preparse" "$tmp_name")rm -rf "$tmp_name" > /etc/null 2&>1if [ "$preparse" = "" ]; thenreturn 4fireturn 0}_upload_certs() {while read rowdoif [ "$row" = "" ]; thencontinueficode=$(echo $row | awk -F ',' '{print 1ドル}')cert_file=$(echo $row | awk -F ',' '{print 2ドル}')cert_key_file=$(echo $row | awk -F ',' '{print 3ドル}')up_status=$(_upload "$code" "$cert_file" "$cert_key_file")if [ "$up_status" != "ok" ]; thencontinuefidone <<EOF$preparseEOF}_check_certs() {while read rowdoif [ "$row" = "" ]; thencontinueficode=$(echo $row | awk -F ',' '{print 1ドル}')cert_file=$(echo $row | awk -F ',' '{print 2ドル}')cert_key_file=$(echo $row | awk -F ',' '{print 3ドル}')check_reposne=$(_check 60 "$code" "$cert_file" "$cert_key_file")_code=$(echo "$check_reposne" | grep 'latest_code' | awk '{print 2ドル}')if [ -n "$_code" ]; thenlatest_code="$_code"fi# done < <( echo "$preparse" )done <<EOF$preparseEOF}_check_dns() {codes=$(echo "$preparse" | awk -F ',' '{print 1ドル}' | tr '\n' ',' )url="/checkDns?codes=$codes"resp=$(_get "$url")status=$(echo "$resp" | head -n 1)case $status in"3")_suc "DNS check pass";;"13")_err "code invalid";;*)_err "$resp";;esac}_reload_nginx() {if [ "$latest_code" = "" ]; thenecho_info "Nginx reload needless."return 0fimsg=$($nginx_bin -t 2>&1)if [ $? != 0 ]; then_remote_log "nginx-test-failed" "$latest_code" "$msg"echo_err "Nginx test failed."elsemsg=$($nginx_bin -s reload 2>&1)if [ "$msg" = "" ]; then_remote_log "nginx-reload-success" "$latest_code" "Nginx reload success."echo_suc "Nginx reload success."else_remote_log "nginx-reload-failed" "$latest_code" "$msg"echo_err "Nginx reload failed. \n\n\n$msg"fifi}version() {echo "$PROJECT_ENTRY v$VER"}# Detect profile file if not specified as environment variable_detect_profile() {if [ -n "$PROFILE" -a -f "$PROFILE" ]; thenecho "$PROFILE"returnfiDETECTED_PROFILE=''SHELLTYPE="$(basename "/$SHELL")"if [ "$SHELLTYPE" = "bash" ]; thenif [ -f "$HOME/.bashrc" ]; thenDETECTED_PROFILE="$HOME/.bashrc"elif [ -f "$HOME/.bash_profile" ]; thenDETECTED_PROFILE="$HOME/.bash_profile"fielif [ "$SHELLTYPE" = "zsh" ]; thenDETECTED_PROFILE="$HOME/.zshrc"fiif [ -z "$DETECTED_PROFILE" ]; thenif [ -f "$HOME/.profile" ]; thenDETECTED_PROFILE="$HOME/.profile"elif [ -f "$HOME/.bashrc" ]; thenDETECTED_PROFILE="$HOME/.bashrc"elif [ -f "$HOME/.bash_profile" ]; thenDETECTED_PROFILE="$HOME/.bash_profile"elif [ -f "$HOME/.zshrc" ]; thenDETECTED_PROFILE="$HOME/.zshrc"fifiif [ -z "$DETECTED_PROFILE" ]; thenif [ -f "/etc/profile" ]; thenDETECTED_PROFILE="/etc/profile"fifiecho "$DETECTED_PROFILE"}_tail_c() {tail -c "1ドル" 2>/dev/null || tail -"1ドル"c}_setopt() {__conf="1ドル"__opt="2ドル"__sep="3ドル"__val="4ドル"__end="5ドル"if [ -z "$__opt" ]; then_usage usage: _setopt '"file" "opt" "=" "value" [";"]'returnfiif [ ! -f "$__conf" ]; thentouch "$__conf"fiif [ -n "$(_tail_c 1 <"$__conf")" ]; thenecho >>"$__conf"fiif grep -n "^$__opt$__sep" "$__conf" >/dev/null; thenif _contains "$__val" "&"; then__val="$(echo "$__val" | sed 's/&/\\&/g')"fiif _contains "$__val" "|"; then__val="$(echo "$__val" | sed 's/|/\\|/g')"fitext="$(cat "$__conf")"printf -- "%s\n" "$text" | sed "s|^$__opt$__sep.*$|$__opt$__sep$__val$__end|" >"$__conf"elif grep -n "^#$__opt$__sep" "$__conf" >/dev/null; thenif _contains "$__val" "&"; then__val="$(echo "$__val" | sed 's/&/\\&/g')"fiif _contains "$__val" "|"; then__val="$(echo "$__val" | sed 's/|/\\|/g')"fitext="$(cat "$__conf")"printf -- "%s\n" "$text" | sed "s|^#$__opt$__sep.*$|$__opt$__sep$__val$__end|" >"$__conf"elseecho "$__opt$__sep$__val$__end" >>"$__conf"fi}_install() {_info "Installing $PROJECT_NAME."_initpathcurl -s "$SCRIPT_URL" > "$PROJECT_ENTRY_BIN" && chmod +x "$PROJECT_ENTRY_BIN"if [ -x "$PROJECT_ENTRY_BIN" ] ; then_suc "Install $PROJECT_NAME complete."else_err "Install $PROJECT_NAME failed."exit 4fiinstallcronjobinstallAlais}installcronjob() {_CRONTAB="crontab"_t=$(_time)random_minute=$(_math $_t % 60)random_hour=$(_math $_t % 9 + 9 ) # 9 ~ 17if ! _exists "$_CRONTAB" ; then_err "$_CRONTAB not exits\n "return 4fiif ! $_CRONTAB -l | grep "$PROJECT_ENTRY" > /dev/null; then_info "Installing cron job."if _exists uname && uname -a | grep SunOS >/dev/null; then_CRONTAB_STDIN="$_CRONTAB --"else_CRONTAB_STDIN="$_CRONTAB -"fi$_CRONTAB -l | {catecho "$random_minute$random_hour * * * '$PROJECT_ENTRY_BIN' -m -r >> '$PROJECT_LOG_FILE' 2>&1"} | $_CRONTAB_STDIN_suc "Install cron job complete."fiif [ "$?" != "0" ]; then_err "Install cron job failed. You can add cronjob by yourself."_err "Or you can add cronjob by yourself:"_err "$random_minute$random_hour * * * '$PROJECT_ENTRY_BIN' -m -r >> '$PROJECT_LOG_FILE' 2>&1"return 1fi}installAlais() {_envfile="$PROJECT_ENTRY_BIN.env"echo "alias $PROJECT_ENTRY=\"$PROJECT_ENTRY_BIN\"" > "$_envfile"_info "Installing alias"_profile="$(_detect_profile)"if [ "$_profile" ]; then_info "Found profile: $_profile"_info "Installing alias to '$_profile'"_setopt "$_profile" ". \"$_envfile\""_suc "OK, Close and reopen your terminal to start using $PROJECT_NAME"else_err "No profile is found, you will need to go into $PROJECT_HOME to use $PROJECT_NAME"fi}_uninstall() {_info "Uninstalling httpsok."uninstallcronjob_uninstallaliasif [ -d "$PROJECT_HOME" ]; then_info "Removing directory $PROJECT_HOME"rm -rf "$PROJECT_HOME"fi_suc "Uninstall httpsok complete."showWelcomeecho "If your need install httpsok agian. Please see $HTTPSOK_HOME_URL .curl -s $SCRIPT_URL | bash -s 'your token'"}_uninstallalias() {_envfile="$PROJECT_ENTRY_BIN.env"_profile="$(_detect_profile)"if [ "$_profile" ]; then_info "Uninstalling alias from: '$_profile'"text="$(cat "$_profile")"echo "$text" | sed "s|^.*\"$_envfile\"$||" >"$_profile"fi}uninstallcronjob() {_CRONTAB="crontab"if ! _exists "$_CRONTAB" ; then_err "$_CRONTAB not exits"return 4ficr="$($_CRONTAB -l | grep "$PROJECT_ENTRY")"if [ "$cr" ]; then_info "Removing cron job"if _exists uname && uname -a | grep SunOS >/dev/null; then$_CRONTAB -l | sed "/$PROJECT_ENTRY/d" | $_CRONTAB --else$_CRONTAB -l | sed "/$PROJECT_ENTRY/d" | $_CRONTAB -fi_suc "Remove cron job complete."fi}_run() {_load_token_check_tokenif ! _preparse ; then_err "No SSL certificate was detected.\n "_info "Please refer to resolve the issue. https://fposter.cn/doc/reference/nginx-config.html "echo ""return 4fi_upload_certs_check_dns_check_certs_reload_nginxecho ""}_process() {while [ ${#} -gt 0 ]; docase "${1}" in--help | -h)showhelpreturn;;--version | -v)versionreturn;;--run | -r)_run;;--setup | -s)_save_token "2ドル"_install_runreturn;;--token | -t)if [ "2ドル" ]; then_save_token "2ドル"else_show_tokenfireturn;;--mode | -m)MODE="crontab";;--install | -i)_installreturn;;--uninstall | -u)_uninstallreturn;;*)echo "Unknown parameter : 1ドル2ドル"return 1;;esacshift 1done}showhelp() {echo "Usage: $PROJECT_ENTRY <command> ... [parameters ...]Commands:-h, --help Show this help message.-v, --version Show version info.-r, --run Run the $PROJECT_NAME-s, --setup Install and run (Recommend first time use it).-t, --token Set or show the token.-m, --mode Mode of normal or crontab.-i, --install Install $PROJECT_NAME to your system.-u, --uninstall Uninstall $PROJECT_NAME in your system."showWelcome}main() {[ -z "1ドル" ] && showhelp && returnif _startswith "1ドル" '-'; then _process "$@"; else _process --setup "$@"; fi}main "$@"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。