tazpanel diff hosts.cgi @ rev 591

undo s/nobody/root/, add "subox/sudo tazpanel" workaround instead
author Xander Ziiryanoff <psychomaniak@xakep.ru>
date Thu Apr 28 23:18:44 2016 +0200 (2016-04-28)
parents 551a881b8292
children b39fc0acf12a
line diff
     1.1 --- a/hosts.cgi	Thu Sep 17 19:49:08 2015 +0100
     1.2 +++ b/hosts.cgi	Thu Apr 28 23:18:44 2016 +0200
     1.3 @@ -103,7 +103,7 @@
     1.4  		host="$(GET add)"
     1.5  
     1.6  		echo "0.0.0.0 $host #U" >> /etc/hosts
     1.7 -		echo -n '<p><span data-img="info"></span>'
     1.8 +		echo -n '<p><span data-img="@info@"></span>'
     1.9  		_ 'Host "%s" added to /etc/hosts.' "$host"
    1.10  		echo '</p>'
    1.11  		;;
    1.12 @@ -116,7 +116,7 @@
    1.13  			sed -i "s|^0.0.0.0[ \t][ \t]*$host .*|#\0|" /etc/hosts
    1.14  		done
    1.15  		r=$(echo "$hosts" | tr ' ' '\n' | wc -l)
    1.16 -		echo -n '<p><span data-img="info"></span>'
    1.17 +		echo -n '<p><span data-img="@info@"></span>'
    1.18  		_p  '%d record disabled' \
    1.19  			'%d records disabled' "$r"   "$r"
    1.20  		echo '</p>'
    1.21 @@ -183,13 +183,13 @@
    1.22  if [ -z "$term" ]; then
    1.23  	getdb hosts | fgrep 0.0.0.0 > "$found"
    1.24  	r=$(wc -l < "$found")
    1.25 -	echo -n '<p><span data-img="info"></span>'
    1.26 +	echo -n '<p><span data-img="@info@"></span>'
    1.27  	_p  '%d record used for Ad blocking' \
    1.28  		'%d records used for Ad blocking' "$r"   "$r"
    1.29  else
    1.30  	getdb hosts | fgrep 0.0.0.0 | fgrep "$term" > "$found"
    1.31  	r=$(wc -l < "$found")
    1.32 -	echo -n '<p><span data-img="info"></span>'
    1.33 +	echo -n '<p><span data-img="@info@"></span>'
    1.34  	_p  '%d record found for "%s"' \
    1.35  		'%d records found for "%s"' "$r"   "$r" "$term"
    1.36  fi
    1.37 @@ -200,7 +200,7 @@
    1.38  cat <<EOT
    1.39  <section>
    1.40  	<header>
    1.41 -		<span data-icon="list">$(_ 'Hosts')</span>
    1.42 +		<span data-icon="@list@">$(_ 'Hosts')</span>
    1.43  		<form>
    1.44  			<input type="search" name="term" value="$(GET term)" results="5" autosave="hosts" autocomplete="on"/>
    1.45  		</form>
    1.46 @@ -215,26 +215,26 @@
    1.47  cat <<EOT
    1.48  </pre>
    1.49  		<footer>
    1.50 -			<button type="submit" name="disable" data-icon="delete" data-root>$(_ 'Disable selected')</button>
    1.51 +			<button type="submit" name="disable" data-icon="@delete@" data-root>$(_ 'Disable selected')</button>
    1.52  		</footer>
    1.53  	</form>
    1.54  </section>
    1.55  
    1.56  <section>
    1.57 -	<header><span data-icon="add">$(_ 'Add')</span></header>
    1.58 +	<header><span data-icon="@add@">$(_ 'Add')</span></header>
    1.59  	<form class="wide">
    1.60  		<div>
    1.61  			$(_ 'Host:')
    1.62  			<input type="text" name="add"/>
    1.63  		</div>
    1.64  		<footer>
    1.65 -			<button type="submit" data-icon="add" data-root>$(_ 'Add')</button>
    1.66 +			<button type="submit" data-icon="@add@" data-root>$(_ 'Add')</button>
    1.67  		</footer>
    1.68  	</form>
    1.69  </section>
    1.70  
    1.71  <section>
    1.72 -	<header><span data-icon="admin">$(_ 'Manage lists')</span></header>
    1.73 +	<header><span data-icon="@admin@">$(_ 'Manage lists')</span></header>
    1.74  	<div>$(_ 'You can use one or more prepared hosts files to block advertisements, malware and other irritants.')</div>
    1.75  	<form class="wide">
    1.76  	<table class="wide zebra">
    1.77 @@ -256,7 +256,7 @@
    1.78  	cat <<EOT
    1.79  <tr>
    1.80  	<td>$name</td>
    1.81 -	<td><a data-icon="info" target="_blank" href="$info">$(_ 'info')</a></td>
    1.82 +	<td><a data-icon="@info@" target="_blank" href="$info">$(_ 'info')</a></td>
    1.83  	<td>
    1.84  		$([ "$updated" == 'monthly'   ] && _ 'Updated monthly')
    1.85  		$([ "$updated" == 'regularly' ] && _ 'Updated regularly')
    1.86 @@ -300,18 +300,18 @@
    1.87  
    1.88  		if [ -f "$HOSTSDIR/$letter.avail" ]; then
    1.89  			cat <<EOT
    1.90 -<button name="uplist" value="$letter" data-icon="upgrade">$(_ 'Upgrade')</button>
    1.91 +<button name="uplist" value="$letter" data-icon="@upgrade@">$(_ 'Upgrade')</button>
    1.92  EOT
    1.93  		fi
    1.94  
    1.95  		cat <<EOT
    1.96 -<button name="remlist" value="$letter" data-icon="remove">$(_ 'Remove')</button>
    1.97 +<button name="remlist" value="$letter" data-icon="@remove@">$(_ 'Remove')</button>
    1.98  EOT
    1.99  
   1.100  	else
   1.101  		# List not installed
   1.102  		cat <<EOT
   1.103 -<button name="instlist" value="$letter" data-icon="install">$(_ 'Install')</button>
   1.104 +<button name="instlist" value="$letter" data-icon="@install@">$(_ 'Install')</button>
   1.105  EOT
   1.106  	fi
   1.107  	echo '</td></tr>'