tinycm diff index.cgi @ rev 121
Remove ashism ==
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Feb 26 12:26:25 2019 +0100 (2019-02-26) |
parents | 05ccbdd25ab5 |
children |
line diff
1.1 --- a/index.cgi Mon Mar 20 00:52:01 2017 +0100 1.2 +++ b/index.cgi Tue Feb 26 12:26:25 2019 +0100 1.3 @@ -142,7 +142,7 @@ 1.4 user="$(echo $auth | cut -d ":" -f 1)" 1.5 md5cookie="$(echo $auth | cut -d ":" -f 2)" 1.6 [ -f "$sessions/$user" ] && md5session="$(cat $sessions/$user)" 1.7 - if [ "$md5cookie" == "$md5session" ] && [ "$auth" ]; then 1.8 + if [ "$md5cookie" = "$md5session" ] && [ "$auth" ]; then 1.9 . $PEOPLE/$user/account.conf 1.10 return 0 1.11 else 1.12 @@ -189,7 +189,7 @@ 1.13 1.14 # Link for online signup if enabled. 1.15 online_signup() { 1.16 - if [ "$ONLINE_SIGNUP" == "yes" ]; then 1.17 + if [ "$ONLINE_SIGNUP" = "yes" ]; then 1.18 echo -n "<p><a href='$script?signup'>" 1.19 gettext "Create a new account" 1.20 echo '</a></p>' 1.21 @@ -256,7 +256,7 @@ 1.22 EOT 1.23 chmod 0600 $PEOPLE/$user/account.conf 1.24 # First created user is admin 1.25 - if [ $(ls ${PEOPLE} | wc -l) == "1" ]; then 1.26 + if [ $(ls ${PEOPLE} | wc -l) = "1" ]; then 1.27 echo "$user" > ${ADMIN_USERS} 1.28 fi 1.29 } 1.30 @@ -302,7 +302,7 @@ 1.31 if [ "$new" ]; then 1.32 echo "Page created by: $(link_user)" | log 1.33 echo "New document: <a href='$script?d=$d'>$d</a>" | log_activity 1.34 - if [ "$HG" == "yes" ]; then 1.35 + if [ "$HG" = "yes" ]; then 1.36 cd $content && hg -q add 1.37 hg commit -q -u "$NAME <$MAIL>" -m "Created new document: $d" 1.38 cd $tiny 1.39 @@ -310,7 +310,7 @@ 1.40 else 1.41 # Here we may clean log: cat && tail -n 40 1.42 echo "Page edited by: $(link_user)" | log 1.43 - if [ "$HG" == "yes" ]; then 1.44 + if [ "$HG" = "yes" ]; then 1.45 cd $content && hg commit -q -u "$NAME <$MAIL>" \ 1.46 -m "Edited document: $d" 1.47 cd $tiny 1.48 @@ -328,7 +328,7 @@ 1.49 <a href="$script?diff=$d">$(gettext "Last diff")</a> 1.50 $PLUGINS_TOOLS 1.51 EOT 1.52 - [ "$HG" == "yes" ] && echo "<a href='$script?hg'>Hg Log</a>" 1.53 + [ "$HG" = "yes" ] && echo "<a href='$script?hg'>Hg Log</a>" 1.54 echo "</div>" 1.55 fi 1.56 } 1.57 @@ -384,7 +384,7 @@ 1.58 user="$(POST auth)" 1.59 pass="$(md5crypt "$(POST pass)")" 1.60 valid=$(fgrep "${user}:" $AUTH_FILE | cut -d ":" -f 2) 1.61 - if [ "$pass" == "$valid" ] && [ "$pass" != "" ]; then 1.62 + if [ "$pass" = "$valid" ] && [ "$pass" != "" ]; then 1.63 md5session=$(echo -n "$$:$user:$pass:$$" | md5sum | awk '{print $1}') 1.64 [ -d $sessions ] || mkdir -p $sessions 1.65 date '+%Y-%m-%d' > ${PEOPLE}/${user}/last 1.66 @@ -467,7 +467,7 @@ 1.67 html_header 1.68 user_box 1.69 # Main activity 1.70 - if [ "$d" == "log" ]; then 1.71 + if [ "$d" = "log" ]; then 1.72 tiny_tools 1.73 echo "<h2>$(gettext "Activity log")</h2>" 1.74 echo '<pre>' 1.75 @@ -585,7 +585,7 @@ 1.76 html_header 1.77 user_box 1.78 echo "<h2>$d</h2>" 1.79 - if [ "$ONLINE_SIGNUP" == "yes" ]; then 1.80 + if [ "$ONLINE_SIGNUP" = "yes" ]; then 1.81 signup_page 1.82 else 1.83 gettext "Online registration is disabled" 1.84 @@ -670,7 +670,7 @@ 1.85 fi 1.86 1.87 # Hg warning if enabled but not initiated 1.88 - if [ "$HG" == "yes" ] && [ ! -d "$content/.hg" ]; then 1.89 + if [ "$HG" = "yes" ] && [ ! -d "$content/.hg" ]; then 1.90 echo '<p class="error box">' 1.91 gettext "Mercurial is enabled but no repository found" 1.92 echo ": <a href='$script?hg=init'>Hg init</a>"