From 82e4d1ca348748e8cdde86f65e62221968cabed5 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 18 Apr 2021 21:46:12 +0200 Subject: Slight refactoring --- src/Module/AptModule.php | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 src/Module/AptModule.php (limited to 'src/Module/AptModule.php') diff --git a/src/Module/AptModule.php b/src/Module/AptModule.php deleted file mode 100644 index ff4cb95..0000000 --- a/src/Module/AptModule.php +++ /dev/null @@ -1,48 +0,0 @@ -enablePTY(); - $ssh->exec("which $this->package"); - - if ($this->state === State::PRESENT) { - $state = ! empty($ssh->read()); - } - else if ($this->state === State::ABSENT) { - $state = empty($ssh->read()); - } - - $ssh->disablePTY(); - - return $state; - } - - public function getCommands(): array - { - if ($this->state === State::PRESENT) { - return [ - "sudo apt install -y $this->package", - ]; - } - else if ($this->state === State::ABSENT) { - return [ - "sudo apt remove -y $this->package", - ]; - } - - return []; - } -} -- cgit v1.2.3