Skip to content

Commit

Permalink
update version linting
Browse files Browse the repository at this point in the history
  • Loading branch information
akerl committed Dec 3, 2023
1 parent 02e104c commit 6d91446
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@
class sdr (
String $rtl_433_version = '23.11',
) {
$version_check = '/usr/local/bin/rtl_433 -V 2>&1 | grep version | cut -d\' \' -f3'

package { [
'rtl-sdr',
'cmake',
]: }

vcsrepo { '/opt/rtl_433':
-> vcsrepo { '/opt/rtl_433':
ensure => present,
provider => git,
source => 'https://github.com/merbanan/rtl_433.git',
revision => $rtl_433_version,
notify => Exec['cmake .. && make install'],
}

-> file { '/opt/rtl_433/build':
Expand All @@ -23,7 +26,7 @@
-> exec { 'cmake .. && make install':
path => '/usr/bin',
cwd => '/opt/rtl_433/build',
unless => "test -f /usr/local/bin/rtl_433 && [ \"$(/usr/local/bin/rtl_433 -V 2>&1 | awk \'/rtl_433 version/ { print \$3 }\')\" == '${rtl_433_version}' ]",
unless => "test -f /usr/local/bin/rtl_433 && [[ \"$(${version_check})\" == '${rtl_433_version}' ]]",
require => Package['cmake'],
}
}

0 comments on commit 6d91446

Please sign in to comment.