-
-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shellcheck : Fix hooks/ #2017
base: dev
Are you sure you want to change the base?
Shellcheck : Fix hooks/ #2017
Conversation
3047a5f
to
b30a680
Compare
a6872ad
to
491e6d9
Compare
a739987
to
df6dc90
Compare
a53d95a
to
e1a1452
Compare
d1fd9f5
to
3730780
Compare
3730780
to
d873ae0
Compare
…asses two empty args...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nginx error on adding domain shoudl be fixed before merging
set -Eeuo pipefail | ||
|
||
# Source YNH helpers | ||
# shellcheck source=../../helpers/helpers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
o_O
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand if it's really needed to add shellcheck source=../../helpers/helpers
slapcat -b dc=yunohost,dc=org -l "${backup_dir}/dc=yunohost-dc=org.ldif" | ||
echo "$backup_dir" > "$tmp_backup_dir_file" | ||
if [ -e /etc/ldap/slapd.conf ]; then | ||
curr_backend=$(grep '^database' /etc/ldap/slapd.conf | awk '{print $2}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to remove the 2> /dev/null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curr_backend=$(grep '^database' /etc/ldap/slapd.conf | awk '{print $2}') | |
curr_backend=$(grep '^database' /etc/ldap/slapd.conf 2> /dev/null | awk '{print $2}') |
echo "$backup_dir" > "$tmp_backup_dir_file" | ||
if [ -e /etc/ldap/slapd.conf ]; then | ||
curr_backend=$(grep '^database' /etc/ldap/slapd.conf | awk '{print $2}') | ||
if [ "$curr_backend" != 'mdb' ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if $curr_backend is empty string ""
? Are you sure it secure to remove [ -n "$curr_backend" ]
if [ "$curr_backend" != 'mdb' ]; then | |
if [ "$curr_backend" != 'mdb' ] && [ -n "$curr_backend" ]; then |
@@ -18,9 +18,12 @@ | |||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
# | |||
|
|||
# Exit hook on subcommand error or unset variable | |||
set -e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test seems to fail for regenconf nginx, so may be that's why we keep only set -e ?
No description provided.