slitaz-arm diff cgi-adm/tools.cgi @ rev 138
cgi-adm: move time setiing to core and misc fixes
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat Apr 26 12:06:42 2014 +0200 (2014-04-26) |
parents | c10b9b20b9a5 |
children | fae61a8c31e0 |
line diff
1.1 --- a/cgi-adm/tools.cgi Sat Apr 26 10:41:23 2014 +0200 1.2 +++ b/cgi-adm/tools.cgi Sat Apr 26 12:06:42 2014 +0200 1.3 @@ -70,6 +70,8 @@ 1.4 mem_used_pct=$(( ( ${mem_used} * 100) / ${mem_total} )) 1.5 cat << EOT 1.6 <pre> 1.7 +System time : $(date) 1.8 +Time zone : $(cat /etc/TZ) 1.9 Kernel : $(uname -snrm) 1.10 Uptime : $(uptime | awk '{print $3}' | sed s"/:/h /" | sed s"/,/min/") 1.11 Network IP : $(echo $ip | awk '{print $1}') 1.12 @@ -83,6 +85,7 @@ 1.13 <form method="get" action="$script"> 1.14 <input type="submit" name="reboot" value="Reboot system" /> 1.15 <input type="submit" name="halt" value="Halt system" /> 1.16 + <input type="submit" name="rdate" value="Set system time" /> 1.17 </form> 1.18 </div> 1.19 EOT 1.20 @@ -104,11 +107,23 @@ 1.21 case " $(GET) " in 1.22 *\ reboot\ *) reboot ;; 1.23 *\ halt\ *) halt ;; 1.24 + 1.25 *\ plugins\ *) 1.26 html_header "Plugins" 1.27 echo "<h1>Plugins list</h1>" 1.28 list_plugins 1.29 html_footer ;; 1.30 + 1.31 + *\ rdate\ *) 1.32 + html_header "System time" 1.33 + echo "<h1>System time</h1>" 1.34 + echo "<pre>" 1.35 + echo -n "Old date: "; date 1.36 + rdate -s tick.greyware.com 1.37 + echo -n "New date: "; date 1.38 + echo "</pre>" 1.39 + html_footer && exit 0 ;; 1.40 + 1.41 *) 1.42 html_header "Admin" 1.43 echo "<h1>System admin</h1>"