コード例 #1
0
    echo "</table>\n";
} else {
    echo "<h3>{$lang['unknown_system']}</h3>";
    echo "<pre style=\"background: #fff;\">";
    echo implode("", $output);
    echo "</pre>";
}
#-------------------------------------------
# This is the only way to turn wifi on and off on the PLUS
#-------------------------------------------
if (is_rachelplus()) {
    echo "\n\t<h2>{$lang['wifi_control']}</h3>\n\t<div style='height: 24px;'>\n\t<div style='float: left; height: 24px; margin-right: 10px;'>{$lang['current_status']}:</div> \n        <div id='wifistat' style='height: 24px;'>&nbsp;</div>\n\t</div>\n\t<div style='margin-top: 10px;'>\n        <button onclick=\"wifiStatus('on');\">{$lang['turn_on']}</button>\n        <button onclick=\"wifiStatus('off');\">{$lang['turn_off']}</button>\n\t</div>\n\t<p>{$lang['wifi_warning']}</p>\n    ";
}
#-------------------------------------------
# We also offer a shutdown option for raspberry pi systems
# (which otherwise might corrupt themselves when unplugged)
#-------------------------------------------
if (is_rachelpi()) {
    echo "\n        <h2>{$lang['system_shutdown']}</h3>\n        <h3>Rachel-Pi</h3>\n        <div style='padding: 10px; border: 1px solid red; background: #fee;'>\n        <form action='hardware.php' method='post'>\n        <input type='submit' name='shutdown' value='{$lang['shutdown']}' onclick=\"if (!confirm('{$lang['confirm_shutdown']}')) { return false; }\">\n        <input type='submit' name='reboot' value='{$lang['restart']}' onclick=\"if (!confirm('{$lang['confirm_restart']}')) { return false; }\">\n        </form>\n        {$lang['shutdown_blurb']}\n        </div>\n    ";
} else {
    if (is_rachelplus()) {
        echo "\n        <h2>{$lang['system_shutdown']}</h3>\n        <h3>RACHEL-Plus</h3>\n        <img src='art/intel-cap-power-button.png' width='250' height='170'>\n        {$lang['rplus_safe_shutdown']}\n        <div style='padding: 10px; border: 1px solid red; background: #fee;'>\n        <form action='hardware.php' method='post'>\n        <input type='submit' name='shutdown' value='{$lang['shutdown']}' onclick=\"if (!confirm('{$lang['confirm_shutdown']}')) { return false; }\">\n        <input type='submit' name='reboot' value='{$lang['restart']}' onclick=\"if (!confirm('{$lang['confirm_restart']}')) { return false; }\">\n        </form>\n        </div>\n    ";
    } else {
        # decided to just not show this for unsupported systems
        #    echo "
        #        <h3>$lang[unknown_system]</h3>
        #        <p>$lang[shutdown_not_supported]</p>
        #    ";
    }
}
include "foot.php";
コード例 #2
0
ファイル: common.php プロジェクト: rachelproject/contentshell
function kiwix_restart()
{
    if (is_rachelpi()) {
        exec("sudo service kiwix restart");
    } else {
        if (is_rachelplus()) {
            exec("bash /root/rachel-scripts/rachelKiwixStart.sh");
        }
    }
}