Skip to content

Commit

Permalink
Merge pull request #1429 from RaspAP/feat/hostapd-restart
Browse files Browse the repository at this point in the history
Reduce hostapd service restart speed + UI tweaks
  • Loading branch information
billz authored Oct 23, 2023
2 parents e85e403 + 3e404b0 commit 3fe3a8d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions app/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,16 @@ function loadChannel() {
}

$('#hostapdModal').on('shown.bs.modal', function (e) {
var seconds = 9;
var seconds = 3;
var pct = 0;
var countDown = setInterval(function(){
if(seconds <= 0){
clearInterval(countDown);
}
var pct = Math.floor(100-(seconds*100/9));
document.getElementsByClassName('progress-bar').item(0).setAttribute('style','width:'+Number(pct)+'%');
seconds --;
}, 1000);
pct = Math.floor(100-(seconds*100/4));
}, 500);
});

$('#configureClientModal').on('shown.bs.modal', function (e) {
Expand Down
6 changes: 3 additions & 3 deletions includes/hostapd.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ function DisplayHostAPDConfig()
if (isset($_POST['StartHotspot']) || isset($_POST['RestartHotspot'])) {
$status->addMessage('Attempting to start hotspot', 'info');
if ($arrHostapdConf['BridgedEnable'] == 1) {
exec('sudo '.RASPI_CONFIG.'/hostapd/servicestart.sh --interface br0 --seconds 3', $return);
exec('sudo '.RASPI_CONFIG.'/hostapd/servicestart.sh --interface br0 --seconds 2', $return);
} elseif ($arrHostapdConf['WifiAPEnable'] == 1) {
exec('sudo '.RASPI_CONFIG.'/hostapd/servicestart.sh --interface uap0 --seconds 3', $return);
exec('sudo '.RASPI_CONFIG.'/hostapd/servicestart.sh --interface uap0 --seconds 2', $return);
} else {
exec('sudo '.RASPI_CONFIG.'/hostapd/servicestart.sh --seconds 3', $return);
exec('sudo '.RASPI_CONFIG.'/hostapd/servicestart.sh --seconds 2', $return);
}
foreach ($return as $line) {
$status->addMessage($line, 'info');
Expand Down
2 changes: 1 addition & 1 deletion templates/hostapd.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title" id="ModalLabel"><i class="fas fa-sync-alt mr-2"></i><?php echo $msg ?></div>
<div class="modal-title" id="ModalLabel"><i class="fas fa-sync-alt fa-spin mr-2"></i><?php echo $msg ?></div>
</div>
<div class="modal-body">
<div class="col-md-12 mb-3 mt-1"><?php echo _("Executing RaspAP service start") ?>...</div>
Expand Down

0 comments on commit 3fe3a8d

Please sign in to comment.