gammu: change startup/config file names to avoid potential conflict 1008/head 958/head
authoraTanW <villy@sft.ru>
Thu, 26 Feb 2015 12:51:39 +0000 (15:51 +0300)
committeraTanW <villy@sft.ru>
Thu, 26 Feb 2015 12:51:39 +0000 (15:51 +0300)
Signed-Off-By: Vitaly Protsko <villy@sft.ru>
---
 Makefile         |    8 ++++----
 files/gammu.init |    8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

utils/gammu/Makefile
utils/gammu/files/gammu [new file with mode: 0644]
utils/gammu/files/gammu.init [new file with mode: 0755]
utils/gammu/files/smsd [deleted file]
utils/gammu/files/smsd.init [deleted file]

index 02e9be07e2e204ce87ebe35bd59cfbec11d48b15..11a5885a7ad4b9c7ba7be7aee228f68cde422515 100644 (file)
@@ -36,7 +36,7 @@ CONFIGURE_ARGS:= \
        --prefix=/usr \
        --cross-root="$(STAGING_DIR) $(TOOLCHAIN_DIR)" \
        --enable-shared \
-       --without-libdbi \
+       --without-libdbi
 
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
@@ -66,12 +66,12 @@ define Package/gammu/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/lib{Gammu*,gsmsd*} $(1)/usr/lib
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_DIR) $(1)/etc/config
-       $(INSTALL_CONF) ./files/smsd $(1)/etc/config/smsd
-       $(INSTALL_BIN) ./files/smsd.init $(1)/etc/init.d/smsd
+       $(INSTALL_CONF) ./files/gammu $(1)/etc/config/gammu
+       $(INSTALL_BIN) ./files/gammu.init $(1)/etc/init.d/gammu
 endef
 
 define Package/gammu/conffiles
-/etc/config/smsd
+/etc/config/gammu
 endef
 
 $(eval $(call BuildPackage,gammu))
diff --git a/utils/gammu/files/gammu b/utils/gammu/files/gammu
new file mode 100644 (file)
index 0000000..d05fb25
--- /dev/null
@@ -0,0 +1,5 @@
+config daemon default
+       option enabled          0
+       option device           /dev/ttyUSB0
+       option connection       at
+       option logfile          syslog
diff --git a/utils/gammu/files/gammu.init b/utils/gammu/files/gammu.init
new file mode 100755 (executable)
index 0000000..6a391d4
--- /dev/null
@@ -0,0 +1,116 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 villy@sft.ru
+
+START=98
+
+USE_PROCD=1
+PROG=/usr/bin/gammu-smsd
+CONFPFX=/var/gammu
+
+start_instance() {
+       local conf="$1"
+       local item
+       local conffile="$CONFPFX-$conf.conf"
+
+       config_get_bool item "$conf" enabled 0
+       [ $item = 0 ] && return
+
+       echo -e "; dont edit. instead look into /etc/config/gammu\n[gammu]\n" > $conffile
+
+       config_get item "$conf" device
+       [ -z "$item" ] && return
+       echo "device = $item" >> $conffile
+
+       config_get item "$conf" connection
+       [ -z "$item" ] && return
+       echo "connection = $item" >> $conffile
+
+       config_get item "$conf" logfile
+       [ -z "$item" ] && item=syslog
+       echo "logfile = $item" >> $conffile
+
+       echo -e "\n[smsd]\nphoneid = $conf\nservice = files\nlogfile = $item" >> $conffile
+       echo -e "checkbattery = 0\nhangupcalls = 1" >> $conffile
+
+       config_get item "$conf" pin
+       [ -n "$item" ] && echo "pin = $item" >> $conffile
+
+       config_get item "$conf" phonecode
+       [ -n "$item" ] && echo "phonecode = $item" >> $conffile
+
+       config_get item "$conf" send
+       [ -n "$item" ] && echo "send = $item" >> $conffile
+
+       config_get item "$conf" receive
+       [ -n "$item" ] && echo "receive = $item" >> $conffile
+
+       config_get item "$conf" timeout
+       [ -n "$item" ] && echo "commtimeout = $item" >> $conffile
+
+       config_get item "$conf" sleep
+       [ -n "$item" ] && echo "loopsleep = $item" >> $conffile
+
+       config_get item "$conf" report
+       [ -n "$item" ] && echo "deliveryreport = $item" >> $conffile
+
+       config_get item "$conf" onreceive
+       [ -n "$item" ] && echo "runonreceive = $item" >> $conffile
+
+       config_get item "$conf" onerror
+       [ -n "$item" ] && echo "runonfailure = $item" >> $conffile
+
+       config_get item "$conf" spool
+       [ -z "$item" ] && item=/var/sms
+       [ ! -d $item ] && {
+         mkdir $item
+         mkdir $item/inbox
+         mkdir $item/outbox
+         mkdir $item/sent
+         mkdir $item/error
+       }
+       echo -e "inboxpath = $item/inbox/\noutboxpath = $item/outbox/" >> $conffile
+       echo -e "sentsmspath = $item/sent/\nerrorsmspath = $item/error/" >> $conffile
+
+       config_get item "$conf" allow
+       [ -n "$item" ] && {
+         local data
+         local allowfile=$CONFPFX-$conf.allow
+         for data in $item ; do
+           echo $data >> $allowfile
+         done
+
+         echo "includenumbersfile = $allowfile" >> $conffile
+       }
+
+       config_get item "$conf" deny
+       [ -n "$item" ] && {
+         local data
+         local denyfile=$CONFPFX-$conf.deny
+         for data in $item ; do
+           echo $data >> $denyfile
+         done
+
+         echo "excludenumbersfile = $denyfile" >> $conffile
+       }
+
+       procd_open_instance
+
+       config_get_bool item "$conf" respawn 0
+       [ $item != 0 ] && procd_set_param respawn
+
+       procd_set_param command $PROG --config=$conffile
+
+       config_get item "$conf" pidfile
+       [ -n "$item" ] && procd_append_param command --pid=$item
+
+       procd_close_instance
+}
+
+start_service() {
+       config_load gammu
+       config_foreach start_instance daemon
+}
+
+service_triggers() {
+       procd_add_reload_trigger "gammu"
+}
diff --git a/utils/gammu/files/smsd b/utils/gammu/files/smsd
deleted file mode 100644 (file)
index d05fb25..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-config daemon default
-       option enabled          0
-       option device           /dev/ttyUSB0
-       option connection       at
-       option logfile          syslog
diff --git a/utils/gammu/files/smsd.init b/utils/gammu/files/smsd.init
deleted file mode 100755 (executable)
index 0a78c48..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2015 villy@sft.ru
-
-START=98
-
-USE_PROCD=1
-PROG=/usr/bin/gammu-smsd
-CONFPFX=/var/smsd
-
-start_instance() {
-       local conf="$1"
-       local item
-       local conffile="$CONFPFX-$conf.conf"
-
-       config_get_bool item "$conf" enabled 0
-       [ $item = 0 ] && return
-
-       echo -e "; dont edit. instead look into /etc/config/smsd\n[gammu]\n" > $conffile
-
-       config_get item "$conf" device
-       [ -z "$item" ] && return
-       echo "device = $item" >> $conffile
-
-       config_get item "$conf" connection
-       [ -z "$item" ] && return
-       echo "connection = $item" >> $conffile
-
-       config_get item "$conf" logfile
-       [ -z "$item" ] && item=syslog
-       echo "logfile = $item" >> $conffile
-
-       echo -e "\n[smsd]\nphoneid = $conf\nservice = files\nlogfile = $item" >> $conffile
-       echo -e "checkbattery = 0\nhangupcalls = 1" >> $conffile
-
-       config_get item "$conf" pin
-       [ -n "$item" ] && echo "pin = $item" >> $conffile
-
-       config_get item "$conf" phonecode
-       [ -n "$item" ] && echo "phonecode = $item" >> $conffile
-
-       config_get item "$conf" send
-       [ -n "$item" ] && echo "send = $item" >> $conffile
-
-       config_get item "$conf" receive
-       [ -n "$item" ] && echo "receive = $item" >> $conffile
-
-       config_get item "$conf" timeout
-       [ -n "$item" ] && echo "commtimeout = $item" >> $conffile
-
-       config_get item "$conf" sleep
-       [ -n "$item" ] && echo "loopsleep = $item" >> $conffile
-
-       config_get item "$conf" report
-       [ -n "$item" ] && echo "deliveryreport = $item" >> $conffile
-
-       config_get item "$conf" onreceive
-       [ -n "$item" ] && echo "runonreceive = $item" >> $conffile
-
-       config_get item "$conf" onerror
-       [ -n "$item" ] && echo "runonfailure = $item" >> $conffile
-
-       config_get item "$conf" spool
-       [ -z "$item" ] && item=/var/sms
-       [ ! -d $item ] && {
-         mkdir $item
-         mkdir $item/inbox
-         mkdir $item/outbox
-         mkdir $item/sent
-         mkdir $item/error
-       }
-       echo -e "inboxpath = $item/inbox/\noutboxpath = $item/outbox/" >> $conffile
-       echo -e "sentsmspath = $item/sent/\nerrorsmspath = $item/error/" >> $conffile
-
-       config_get item "$conf" allow
-       [ -n "$item" ] && {
-         local data
-         local allowfile=$CONFPFX-$conf.allow
-         for data in $item ; do
-           echo $data >> $allowfile
-         done
-
-         echo "includenumbersfile = $allowfile" >> $conffile
-       }
-
-       config_get item "$conf" deny
-       [ -n "$item" ] && {
-         local data
-         local denyfile=$CONFPFX-$conf.deny
-         for data in $item ; do
-           echo $data >> $denyfile
-         done
-
-         echo "excludenumbersfile = $denyfile" >> $conffile
-       }
-
-       procd_open_instance
-
-       config_get_bool item "$conf" respawn 0
-       [ $item != 0 ] && procd_set_param respawn
-
-       procd_set_param command $PROG --config=$conffile
-
-       config_get item "$conf" pidfile
-       [ -n "$item" ] && procd_append_param command --pid=$item
-
-       procd_close_instance
-}
-
-start_service() {
-       config_load smsd
-       config_foreach start_instance daemon
-}
-
-service_triggers() {
-       procd_add_reload_trigger "smsd"
-}