Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
0a7c9364
Commit
0a7c9364
authored
Apr 17, 2016
by
neil
Browse files
modify shebang to bash after install if bash is installed.
parent
c5f2df5c
Changes
5
Show whitespace changes
Inline
Side-by-side
acme.sh
View file @
0a7c9364
#!/usr/bin/env
ba
sh
#!/usr/bin/env sh
VER
=
2.2.1
PROJECT_NAME
=
"acme.sh"
...
...
@@ -1844,6 +1844,19 @@ _precheck() {
return
0
}
_setShebang
()
{
_file
=
"
$1
"
_shebang
=
"
$2
"
if
[
-z
"
$_shebang
"
]
;
then
_err
"Usage: file shebang"
return
1
fi
cp
"
$_file
"
"
$_file
.tmp"
echo
"
$_shebang
"
>
"
$_file
"
sed
-n
2,99999p
"
$_file
.tmp"
>>
"
$_file
"
rm
-f
"
$_file
.tmp"
}
install
()
{
if
!
_initpath
;
then
...
...
@@ -1938,6 +1951,18 @@ install() {
installcronjob
#Modify shebang
if
_exists bash
;
then
_info
"Good, bash is installed, change the shebang to use bash as prefered."
_shebang
=
'#!/usr/bin/env bash'
_setShebang
"
$LE_WORKING_DIR
/
$PROJECT_ENTRY
"
"
$_shebang
"
if
[
-d
"
$LE_WORKING_DIR
/dnsapi"
]
;
then
for
_apifile
in
$(
ls
"
$LE_WORKING_DIR
/dnsapi/"
*
.sh
)
;
do
_setShebang
"
$_apifile
"
"
$_shebang
"
done
fi
fi
_info OK
}
...
...
dnsapi/dns_cf.sh
View file @
0a7c9364
#!/usr/bin/env
ba
sh
#!/usr/bin/env sh
#
...
...
dnsapi/dns_cx.sh
View file @
0a7c9364
#!/usr/bin/env
ba
sh
#!/usr/bin/env sh
# Cloudxns.com Domain api
#
...
...
dnsapi/dns_dp.sh
View file @
0a7c9364
#!/usr/bin/env
ba
sh
#!/usr/bin/env sh
# Dnspod.cn Domain api
#
...
...
dnsapi/dns_myapi.sh
View file @
0a7c9364
#!/usr/bin/env
ba
sh
#!/usr/bin/env sh
#Here is a sample custom api script.
#This file name is "dns_myapi.sh"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment