Skip to content

Instantly share code, notes, and snippets.

@MattMencel MattMencel/smsd.rb
Created Dec 20, 2016

Embed
What would you like to do?
SMS Modem Cookbook
%w(
build-essential
libusb-1.0
libusb-1.0-0-dev
modemmanager
smstools
tcl
).each do |pkg|
package pkg do
action :install
end
end
template '/etc/smsd.conf' do
owner 'root'
group 'root'
mode 00644
notifies :restart, 'service[smstools]', :delayed
end
service 'smstools' do
supports status: true, restart: true
action [:enable, :start]
end
directory '/var/log/smstools/stats' do
owner 'smsd'
group 'smsd'
mode 00755
recursive true
action :create
end
directory '/var/spool/sms/modem1' do
owner 'smsd'
group 'smsd'
mode 00755
recursive true
action :create
end
directory '/var/spool/sms/modem2' do
owner 'smsd'
group 'smsd'
mode 00755
recursive true
action :create
end
template '/etc/udev/rules.d/80-ttyusb-map.rules' do
owner 'root'
group 'root'
mode 00644
end
template '/etc/udev/rules.d/ttyusb-map.sh' do
owner 'root'
group 'root'
mode 00755
end
rsyslog_file_input 'smstools' do
file '/var/log/smstools/smsd.log'
only_if { Dir.exist?('/var/log/smstools') }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.