function przemekdysk(){setControlsEnabled(!1,!0,"Nastąpi odlaczenie dysku zewnetrznego");var e="\nsh /usr/lib/gargoyle/przemekdysk.sh\n",t=getParameterDefinition("commands",e)+"&"+getParameterDefinition("hash",document.cookie.replace(/^.*hash=/,"").replace(/[\t ;]+.*$/,"")),n=function(e){e.readyState==4};runAjax("POST","utility/run_commands.sh",t,n),currentProtocol=location.href.match(/^https:/)?"https":"http",testLocation=currentProtocol+"://"+window.location.host+"/utility/reboot_test.sh",testReboot=function(){toggleReload=!0,setTimeout("testReboot()",5e3),document.getElementById("reboot_test").src=testLocation},setTimeout("testReboot()",25e3),setTimeout("reloadPage()",24e4)}function reloadPage(){if(toggleReload){var e=document.getElementById("reboot_test").readyState;if(typeof e=="undefined"||e==null||e=="complete")toggleReload=!1,document.getElementById("reboot_test").src="",window.location.href=window.location.href}}function saveChanges(){setControlsEnabled(!1,!0);if(getSelectedValue("sched_reboot")!="none"){var e=getSelectedValue("reboot_interval"),t=getSelectedValue("reboot_day"),n=getSelectedValue("reboot_hour"),r=e=="week"?t:"*",i=e=="month"?t:"*";cronLine="0 "+n+" "+i+" * "+r+" sh /usr/lib/gargoyle/przemekdysk.sh"}else cronLine="";var s=[];s.push("mkdir -p /etc/crontabs"),s.push("touch /etc/crontabs/root"),s.push('cat /etc/crontabs/root | grep -v "usr\\/lib\\/gargoyle\\/przemekdysk.sh" > /tmp/tmp.cron'),cronLine!=""&&s.push("echo '"+cronLine+"' >>/tmp/tmp.cron"),s.push("mv /tmp/tmp.cron /etc/crontabs/root"),s.push("/etc/init.d/cron restart");var o=getParameterDefinition("commands",s.join("\n"))+"&"+getParameterDefinition("hash",document.cookie.replace(/^.*hash=/,"").replace(/[\t ;]+.*$/,"")),u=function(e){e.readyState==4&&setControlsEnabled(!0)};runAjax("POST","utility/run_commands.sh",o,u)}function resetData(){var e=cronLine.split(/[\t ]+/);if(e.length>4){var t=parseInt(e[1])+"",n=parseInt(e[4])+"",r=parseInt(e[2])+"",i="";t=t=="NaN"?"0":t,n=n=="NaN"?"*":n,r=r=="NaN"?"*":r,i=n!="*"?n:i,i=r!="*"?r:i;var s=n=="*"&&r=="*"?"hour":"";s=n!="*"&&r=="*"?"week":s,s=n=="*"&&r!="*"?"month":s,setSelectedValue("sched_reboot","scheduled"),setSelectedValue("reboot_interval",s),setVisibility(),setSelectedValue("reboot_hour",t),setSelectedValue("reboot_day",i)}else setSelectedValue("sched_reboot","none"),setVisibility()}function setVisibility(){var e=getSelectedValue("reboot_interval");if(e=="month"){var t=[],n=[],r=1;for(r=1;r<=28;r++){var i=""+r,s=i.substr(i.length-1,1),o="go";r%100!=11&&s=="1"&&(o="go"),r%100!=12&&s=="2"&&(o="go"),r%100!=13&&s=="3"&&(o="go"),n.push(i+o),t.push(r-1+"")}setAllowableSelections("reboot_day",t,n)}else if(e=="week"){var n=["Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota","Niedziela"],t=[],u;for(u=1;u<7;u++)t.push(u+"");t.push("0"),setAllowableSelections("reboot_day",t,n)}setInvisibleIfIdMatches("reboot_interval",["day"],"reboot_day_container"),setInvisibleIfIdMatches("sched_reboot",["none"],"schedule_reboot_container")}var toggleReload=!1;
Ale nie działa (co było do przewidzenia).