mirror of
https://github.com/pragma-/pbot.git
synced 2025-07-21 21:07:24 +02:00
applets/qalc.pl: make qalc safe
This commit is contained in:
parent
4582e225e5
commit
9d29336cb2
6
applets/.qalc-safe-1
vendored
Normal file
6
applets/.qalc-safe-1
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
set save definitions 1
|
||||
function export 0
|
||||
function load 0
|
||||
function command 0
|
||||
function save 0
|
||||
exit
|
2
applets/.qalc-safe-2
vendored
Normal file
2
applets/.qalc-safe-2
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
set save definitions 0
|
||||
exit
|
3
applets/qalc-safe
vendored
Executable file
3
applets/qalc-safe
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
#/usr/bin/sh
|
||||
yes | qalc -f .qalc-safe-1
|
||||
qalc -f .qalc-safe-2
|
12
applets/qalc.pl
vendored
12
applets/qalc.pl
vendored
@ -11,6 +11,18 @@ if (not @ARGV) {
|
||||
exit;
|
||||
}
|
||||
|
||||
my $is_safe = `qalc export`;
|
||||
|
||||
if ($is_safe ne "export() = 0\n") {
|
||||
system("./qalc-safe > /dev/null");
|
||||
|
||||
$is_safe = `qalc export`;
|
||||
if ($is_safe ne "export() = 0\n") {
|
||||
print "Fatal: Unable to make qalc safe. Execute `qalc-safe` and check for errors.\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
my $result = `ulimit -t 2; qalc \Q@ARGV\E`;
|
||||
|
||||
$result =~ s/^.*approx.\s+//;
|
||||
|
@ -25,8 +25,8 @@ use PBot::Imports;
|
||||
# These are set by the /misc/update_version script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 4875,
|
||||
BUILD_DATE => "2025-07-19",
|
||||
BUILD_REVISION => 4876,
|
||||
BUILD_DATE => "2025-07-20",
|
||||
};
|
||||
|
||||
sub initialize {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user