-
Notifications
You must be signed in to change notification settings - Fork 11
/
startstop.php
executable file
·59 lines (52 loc) · 2.05 KB
/
startstop.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
include ("header.php");
include ("pass.php");
$walletDir = "/home/stakebox/wallets/".$currentWallet;
$dataDir = "/home/stakebox/.Hyper";
?>
<div style="padding: 5px 30px 0px;">
<div class="row">
<div class="col-lg-2">
<form action="startstop" method="POST"><input type="hidden">
<div class="input-group">
<button class='btn btn-default' type="submit" name="status" value="stop">Stop The Wallet</button>
</div><!-- /input-group -->
</form>
</div><!-- /.col-lg-2 -->
<div class="col-lg-2">
<form action="startstop" method="POST"><input type="hidden">
<div class="input-group">
<button class='btn btn-default' type="submit" name="status" value="start">Start The Wallet</button>
</div><!-- /input-group -->
</form>
</div><!-- /.col-lg-2 -->
<div class="col-lg-2">
<form action="startstop" method="POST"><input type="hidden">
<div class="input-group">
<button class='btn btn-default' type="submit" name="status" value="rescan">Start The Wallet With -rescan Option</button>
</div><!-- /input-group -->
</form>
</div><!-- /.col-lg-2 -->
</div><!-- /.row -->
<?php
$status = $_POST["status"];
if ($status == "stop"){
$coin->stop();
print '<h2>You have stopped the wallet, please allow it a minute or so to fully stop before restarting.</h2>';
}
if ($status == "start"){
chdir($walletDir);
echo getcwd() . "\n";
echo "$currentWallet"." -datadir="."$dataDir";
shell_exec("$currentWallet"." -datadir="."$dataDir");
print '<h2>The wallet is starting, it could take several minutes before it is available.</h2>';
}
if ($status == "rescan"){
chdir($walletDir);
exec($currentWallet -rescan);
print '<h2>The wallet is starting with the rescan option, it may take a while before it becomes available again.</h2>';
}
?>
</div>
</div>
<?php include ("footer.php"); ?>