# HG changeset patch # User Pascal Bellard # Date 1551180385 -3600 # Node ID 0893f1ab023c7f058f49f08d3636233b935054bd # Parent 798212b3ce40a97edbc7543af1ed75c05f346c4b Remove ashism == diff -r 798212b3ce40 -r 0893f1ab023c index.cgi --- a/index.cgi Fri Mar 24 23:59:43 2017 +0100 +++ b/index.cgi Tue Feb 26 12:26:25 2019 +0100 @@ -142,7 +142,7 @@ user="$(echo $auth | cut -d ":" -f 1)" md5cookie="$(echo $auth | cut -d ":" -f 2)" [ -f "$sessions/$user" ] && md5session="$(cat $sessions/$user)" - if [ "$md5cookie" == "$md5session" ] && [ "$auth" ]; then + if [ "$md5cookie" = "$md5session" ] && [ "$auth" ]; then . $PEOPLE/$user/account.conf return 0 else @@ -189,7 +189,7 @@ # Link for online signup if enabled. online_signup() { - if [ "$ONLINE_SIGNUP" == "yes" ]; then + if [ "$ONLINE_SIGNUP" = "yes" ]; then echo -n "

" gettext "Create a new account" echo '

' @@ -256,7 +256,7 @@ EOT chmod 0600 $PEOPLE/$user/account.conf # First created user is admin - if [ $(ls ${PEOPLE} | wc -l) == "1" ]; then + if [ $(ls ${PEOPLE} | wc -l) = "1" ]; then echo "$user" > ${ADMIN_USERS} fi } @@ -302,7 +302,7 @@ if [ "$new" ]; then echo "Page created by: $(link_user)" | log echo "New document: $d" | log_activity - if [ "$HG" == "yes" ]; then + if [ "$HG" = "yes" ]; then cd $content && hg -q add hg commit -q -u "$NAME <$MAIL>" -m "Created new document: $d" cd $tiny @@ -310,7 +310,7 @@ else # Here we may clean log: cat && tail -n 40 echo "Page edited by: $(link_user)" | log - if [ "$HG" == "yes" ]; then + if [ "$HG" = "yes" ]; then cd $content && hg commit -q -u "$NAME <$MAIL>" \ -m "Edited document: $d" cd $tiny @@ -328,7 +328,7 @@ $(gettext "Last diff") $PLUGINS_TOOLS EOT - [ "$HG" == "yes" ] && echo "Hg Log" + [ "$HG" = "yes" ] && echo "Hg Log" echo "" fi } @@ -384,7 +384,7 @@ user="$(POST auth)" pass="$(md5crypt "$(POST pass)")" valid=$(fgrep "${user}:" $AUTH_FILE | cut -d ":" -f 2) - if [ "$pass" == "$valid" ] && [ "$pass" != "" ]; then + if [ "$pass" = "$valid" ] && [ "$pass" != "" ]; then md5session=$(echo -n "$$:$user:$pass:$$" | md5sum | awk '{print $1}') [ -d $sessions ] || mkdir -p $sessions date '+%Y-%m-%d' > ${PEOPLE}/${user}/last @@ -467,7 +467,7 @@ html_header user_box # Main activity - if [ "$d" == "log" ]; then + if [ "$d" = "log" ]; then tiny_tools echo "

$(gettext "Activity log")

" echo '
'
@@ -585,7 +585,7 @@
 		html_header
 		user_box
 		echo "

$d

" - if [ "$ONLINE_SIGNUP" == "yes" ]; then + if [ "$ONLINE_SIGNUP" = "yes" ]; then signup_page else gettext "Online registration is disabled" @@ -670,7 +670,7 @@ fi # Hg warning if enabled but not initiated - if [ "$HG" == "yes" ] && [ ! -d "$content/.hg" ]; then + if [ "$HG" = "yes" ] && [ ! -d "$content/.hg" ]; then echo '

' gettext "Mercurial is enabled but no repository found" echo ": Hg init" diff -r 798212b3ce40 -r 0893f1ab023c plugins/blog/blog.cgi --- a/plugins/blog/blog.cgi Fri Mar 24 23:59:43 2017 +0100 +++ b/plugins/blog/blog.cgi Tue Feb 26 12:26:25 2019 +0100 @@ -14,8 +14,8 @@ $(gettext "New post") $(gettext "Archives") Dashboard - $([ "$index" == "blog" ] && echo "Index") - $([ "$HG" == "yes" ] && echo "Hg Log") + $([ "$index" = "blog" ] && echo "Index") + $([ "$HG" = "yes" ] && echo "Hg Log") EOT fi @@ -111,7 +111,7 @@ } # RSS feed requested -if [ "$(GET blog)" == "rss" ]; then +if [ "$(GET blog)" = "rss" ]; then rss && exit 0 fi @@ -151,7 +151,7 @@ fi blog_tools # New post - if [ "$p" == "new" ]; then + if [ "$p" = "new" ]; then last=$(ls $blog | sort -r -n | head -n 1) p=$(($last + 1)) AUTHOR="$user" diff -r 798212b3ce40 -r 0893f1ab023c plugins/community/community.cgi --- a/plugins/community/community.cgi Fri Mar 24 23:59:43 2017 +0100 +++ b/plugins/community/community.cgi Tue Feb 26 12:26:25 2019 +0100 @@ -13,7 +13,7 @@ user_box # Wall is only for logged users - if [ "$WALL_MODE" == "private" ] && ! check_auth; then + if [ "$WALL_MODE" = "private" ] && ! check_auth; then gettext "Private Wall - You must be logged in to read the wall" html_footer && exit 0 fi @@ -33,7 +33,7 @@ if [ "$(GET delmsg)" ] && check_auth; then m=$(GET delmsg) author=$(echo ${m} | cut -d "_" -f 3) - if [ "$user" == "${author%.txt}" ] || admin_user; then + if [ "$user" = "${author%.txt}" ] || admin_user; then rm -f ${wall}/${m} fi fi @@ -71,7 +71,7 @@

By ${author%.txt} - ${pubdate} EOT - if [ "$user" == "${author%.txt}" ] || admin_user; then + if [ "$user" = "${author%.txt}" ] || admin_user; then echo " - Delete" fi echo "

" diff -r 798212b3ce40 -r 0893f1ab023c plugins/dashboard/dashboard.cgi --- a/plugins/dashboard/dashboard.cgi Fri Mar 24 23:59:43 2017 +0100 +++ b/plugins/dashboard/dashboard.cgi Tue Feb 26 12:26:25 2019 +0100 @@ -12,7 +12,7 @@ wikisize="$(du -sh $wiki | awk '{print $1}')" cachesize="$(du -sh $cache | awk '{print $1}')" [ "$HG" != "yes" ] && hg=$(gettext "disabled") - [ "$HG" == "yes" ] && hg=$(gettext "enabled") + [ "$HG" = "yes" ] && hg=$(gettext "enabled") # Source all plugins.conf to get DASHBOARD_TOOLS and ADMIN_TOOLS ADMIN_TOOLS="" DASHBOARD_TOOLS="" diff -r 798212b3ce40 -r 0893f1ab023c plugins/export/export.cgi --- a/plugins/export/export.cgi Fri Mar 24 23:59:43 2017 +0100 +++ b/plugins/export/export.cgi Tue Feb 26 12:26:25 2019 +0100 @@ -74,7 +74,7 @@ for d in $(find . -type f | sed s'!./!!') do d=${d%.txt} - [ "$d" == "en/help" ] && continue + [ "$d" = "en/help" ] && continue gettext "Exporting: "; echo "$d.txt" mkdir -p $tmpdir/$export/$(dirname $d) f=$tmpdir/$export/$d.html diff -r 798212b3ce40 -r 0893f1ab023c plugins/forum/forum.cgi --- a/plugins/forum/forum.cgi Fri Mar 24 23:59:43 2017 +0100 +++ b/plugins/forum/forum.cgi Tue Feb 26 12:26:25 2019 +0100 @@ -15,8 +15,8 @@

$(gettext "New post") $([ "$(GET t)" ] && echo "Forum") - $([ "$index" == "forum" ] && echo "Index") - $([ "$HG" == "yes" ] && echo "Hg Log") + $([ "$index" = "forum" ] && echo "Index") + $([ "$HG" = "yes" ] && echo "Hg Log")
EOT } @@ -120,13 +120,13 @@ show_messages() { msgs=$(ls -1 $forum/$t/msg.*.txt | wc -l) echo "

$(gettext 'Messages'): $msgs

" - [ "$msgs" == 0 ] && echo "

$(gettext 'Be the first to post a message!')

" + [ "$msgs" = 0 ] && echo "

$(gettext 'Be the first to post a message!')

" for msg in $(ls -1tr $forum/$t/msg.*.conf) do . ${msg} rm="" # User can delete his post. - if [ "$user" == "$AUTHOR" ]; then + if [ "$user" = "$AUTHOR" ]; then rm="- $(gettext 'Remove')" fi # Display user gravatar, date and message @@ -167,7 +167,7 @@ html_footer && exit 0 fi # New post - if [ "$t" == "new" ]; then + if [ "$t" = "new" ]; then date=$(date '+%Y-%m-%d %H:%M') last=$(ls -r $forum | head -n 1) nb=${last%.txt} diff -r 798212b3ce40 -r 0893f1ab023c plugins/users/users.cgi --- a/plugins/users/users.cgi Fri Mar 24 23:59:43 2017 +0100 +++ b/plugins/users/users.cgi Tue Feb 26 12:26:25 2019 +0100 @@ -197,7 +197,7 @@ $(gettext "User name :") $USER $(gettext "Last login :") $last EOT - if check_auth && [ "$(GET user)" == "$user" ]; then + if check_auth && [ "$(GET user)" = "$user" ]; then auth_people else # check_auth will set VARS to current logged user: re-source diff -r 798212b3ce40 -r 0893f1ab023c tinycm --- a/tinycm Fri Mar 24 23:59:43 2017 +0100 +++ b/tinycm Tue Feb 26 12:26:25 2019 +0100 @@ -137,7 +137,7 @@ done # Set permissions - if [ $(id -u) == 0 ]; then + if [ $(id -u) = 0 ]; then chown -R www.www ${path}/content install -d -o www -g www ${path}/cache else