forked from alexwbaule/telegramopenwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
214 lines (193 loc) · 8.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
include $(TOPDIR)/rules.mk
PKG_NAME:=telegram-openwrt
PKG_VERSION:=1.0.4
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
define Package/telegram-openwrt
SECTION:=net
CATEGORY:=Network
TITLE:=Telegram BOT for openwrt
URL:=https://github.com/alexwbaule/telegramopenwrt
PKGARCH:=all
TITLE:=Telegram for openwrt BOT
endef
define Package/telegram-openwrt/description
Telegram for use in openwrt. Its a BOT
that executes selected commands in your router.
Version: $(PKG_VERSION)-$(PKG_RELEASE)
Info : https://github.com/alexwbaule/telegramopenwrt
endef
define Package/telegram-openwrt/conffiles
/etc/config/telegramopenwrt
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/telegram-openwrt/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./etc/init.d/telegram_bot \
./etc/init.d/lanports \
./etc/init.d/hosts_scan \
$(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./etc/config/telegramopenwrt \
$(1)/etc/config/telegramopenwrt
$(INSTALL_DIR) $(1)/etc/telegramopenwrt
$(INSTALL_CONF) ./etc/telegramopenwrt/macaddr.ignore \
$(1)/etc/telegramopenwrt/macaddr.ignore
$(INSTALL_DIR) $(1)/usr/share/telegramopenwrt
echo "$(PKG_VERSION)-$(PKG_RELEASE)" > $(1)/usr/share/telegramopenwrt/version
$(INSTALL_DIR) $(1)/usr/lib/telegramopenwrt/plugins/actions
$(INSTALL_BIN) ./usr/lib/telegramopenwrt/plugins/actions/cam_mv \
./usr/lib/telegramopenwrt/plugins/actions/fwr_disable \
./usr/lib/telegramopenwrt/plugins/actions/fw_delete \
./usr/lib/telegramopenwrt/plugins/actions/proc_stop \
./usr/lib/telegramopenwrt/plugins/actions/fwr_enable \
./usr/lib/telegramopenwrt/plugins/actions/chromego \
./usr/lib/telegramopenwrt/plugins/actions/fw_disable \
./usr/lib/telegramopenwrt/plugins/actions/wifi_disable \
./usr/lib/telegramopenwrt/plugins/actions/proxy_enable \
./usr/lib/telegramopenwrt/plugins/actions/wifi_restart \
./usr/lib/telegramopenwrt/plugins/actions/proc_restart \
./usr/lib/telegramopenwrt/plugins/actions/proxy_disable \
./usr/lib/telegramopenwrt/plugins/actions/wifi_enable \
./usr/lib/telegramopenwrt/plugins/actions/light_control \
./usr/lib/telegramopenwrt/plugins/actions/proc_start \
./usr/lib/telegramopenwrt/plugins/actions/fw_enable \
$(1)/usr/lib/telegramopenwrt/plugins/actions
$(INSTALL_DIR) $(1)/usr/lib/telegramopenwrt/plugins/ctx
$(INSTALL_BIN) ./usr/lib/telegramopenwrt/plugins/ctx/wifi_list \
./usr/lib/telegramopenwrt/plugins/ctx/fwr_list \
./usr/lib/telegramopenwrt/plugins/ctx/service_list \
./usr/lib/telegramopenwrt/plugins/ctx/chromego \
./usr/lib/telegramopenwrt/plugins/ctx/reboot \
./usr/lib/telegramopenwrt/plugins/ctx/cam_kbd \
./usr/lib/telegramopenwrt/plugins/ctx/proxy \
./usr/lib/telegramopenwrt/plugins/ctx/fw_list \
./usr/lib/telegramopenwrt/plugins/ctx/light_list \
$(1)/usr/lib/telegramopenwrt/plugins/ctx
$(INSTALL_DIR) $(1)/usr/lib/telegramopenwrt/plugins/help
$(INSTALL_DATA) ./usr/lib/telegramopenwrt/plugins/help/cam_mv \
./usr/lib/telegramopenwrt/plugins/help/fw_unblock \
./usr/lib/telegramopenwrt/plugins/help/fw_add \
./usr/lib/telegramopenwrt/plugins/help/cam_vdo \
./usr/lib/telegramopenwrt/plugins/help/fwr_disable \
./usr/lib/telegramopenwrt/plugins/help/msg_tv \
./usr/lib/telegramopenwrt/plugins/help/wifi_list \
./usr/lib/telegramopenwrt/plugins/help/swports_list \
./usr/lib/telegramopenwrt/plugins/help/fwr_list \
./usr/lib/telegramopenwrt/plugins/help/fw_delete \
./usr/lib/telegramopenwrt/plugins/help/chromego_list \
./usr/lib/telegramopenwrt/plugins/help/get_mac \
./usr/lib/telegramopenwrt/plugins/help/proc_stop \
./usr/lib/telegramopenwrt/plugins/help/proc_list \
./usr/lib/telegramopenwrt/plugins/help/proxy_list \
./usr/lib/telegramopenwrt/plugins/help/get_uptime \
./usr/lib/telegramopenwrt/plugins/help/fwr_enable \
./usr/lib/telegramopenwrt/plugins/help/wll_list \
./usr/lib/telegramopenwrt/plugins/help/start \
./usr/lib/telegramopenwrt/plugins/help/ignoredmac_list \
./usr/lib/telegramopenwrt/plugins/help/fw_disable \
./usr/lib/telegramopenwrt/plugins/help/lights \
./usr/lib/telegramopenwrt/plugins/help/wifi_disable \
./usr/lib/telegramopenwrt/plugins/help/proxy_enable \
./usr/lib/telegramopenwrt/plugins/help/wifi_restart \
./usr/lib/telegramopenwrt/plugins/help/proc_restart \
./usr/lib/telegramopenwrt/plugins/help/reboot \
./usr/lib/telegramopenwrt/plugins/help/proxy_disable \
./usr/lib/telegramopenwrt/plugins/help/wifi_enable \
./usr/lib/telegramopenwrt/plugins/help/get_ip \
./usr/lib/telegramopenwrt/plugins/help/cam_shot \
./usr/lib/telegramopenwrt/plugins/help/cam_movie \
./usr/lib/telegramopenwrt/plugins/help/get_ping \
./usr/lib/telegramopenwrt/plugins/help/fw_list \
./usr/lib/telegramopenwrt/plugins/help/chromego_add \
./usr/lib/telegramopenwrt/plugins/help/proc_start \
./usr/lib/telegramopenwrt/plugins/help/ignoredmac_add \
./usr/lib/telegramopenwrt/plugins/help/chromego_del \
./usr/lib/telegramopenwrt/plugins/help/fw_enable \
./usr/lib/telegramopenwrt/plugins/help/hst_list \
./usr/lib/telegramopenwrt/plugins/help/netstat \
$(1)/usr/lib/telegramopenwrt/plugins/help
$(INSTALL_DIR) $(1)/usr/lib/telegramopenwrt/plugins
$(INSTALL_BIN) ./usr/lib/telegramopenwrt/plugins/cam_mv \
./usr/lib/telegramopenwrt/plugins/fw_unblock \
./usr/lib/telegramopenwrt/plugins/fw_add \
./usr/lib/telegramopenwrt/plugins/cam_vdo \
./usr/lib/telegramopenwrt/plugins/fwr_disable \
./usr/lib/telegramopenwrt/plugins/msg_tv \
./usr/lib/telegramopenwrt/plugins/wifi_list \
./usr/lib/telegramopenwrt/plugins/swports_list \
./usr/lib/telegramopenwrt/plugins/fwr_list \
./usr/lib/telegramopenwrt/plugins/fw_delete \
./usr/lib/telegramopenwrt/plugins/chromego_list \
./usr/lib/telegramopenwrt/plugins/get_mac \
./usr/lib/telegramopenwrt/plugins/proc_stop \
./usr/lib/telegramopenwrt/plugins/proc_list \
./usr/lib/telegramopenwrt/plugins/proxy_list \
./usr/lib/telegramopenwrt/plugins/get_uptime \
./usr/lib/telegramopenwrt/plugins/fwr_enable \
./usr/lib/telegramopenwrt/plugins/wll_list \
./usr/lib/telegramopenwrt/plugins/start \
./usr/lib/telegramopenwrt/plugins/ignoredmac_list \
./usr/lib/telegramopenwrt/plugins/fw_disable \
./usr/lib/telegramopenwrt/plugins/lights \
./usr/lib/telegramopenwrt/plugins/wifi_disable \
./usr/lib/telegramopenwrt/plugins/proxy_enable \
./usr/lib/telegramopenwrt/plugins/wifi_restart \
./usr/lib/telegramopenwrt/plugins/proc_restart \
./usr/lib/telegramopenwrt/plugins/reboot \
./usr/lib/telegramopenwrt/plugins/proxy_disable \
./usr/lib/telegramopenwrt/plugins/wifi_enable \
./usr/lib/telegramopenwrt/plugins/get_ip \
./usr/lib/telegramopenwrt/plugins/cam_shot \
./usr/lib/telegramopenwrt/plugins/cam_movie \
./usr/lib/telegramopenwrt/plugins/get_ping \
./usr/lib/telegramopenwrt/plugins/fw_list \
./usr/lib/telegramopenwrt/plugins/chromego_add \
./usr/lib/telegramopenwrt/plugins/proc_start \
./usr/lib/telegramopenwrt/plugins/ignoredmac_add \
./usr/lib/telegramopenwrt/plugins/chromego_del \
./usr/lib/telegramopenwrt/plugins/fw_enable \
./usr/lib/telegramopenwrt/plugins/hst_list \
./usr/lib/telegramopenwrt/plugins/netstat \
$(1)/usr/lib/telegramopenwrt/plugins
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) ./sbin/telebot \
./sbin/camkeyboard \
./sbin/telegram_bot \
./sbin/telekeyboard \
./sbin/hosts_scan \
./sbin/proxy \
./sbin/typing \
./sbin/telegram_sender \
./sbin/lanports \
$(1)/sbin/
endef
define Package/telegram-openwrt/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
/etc/init.d/telegram_bot enabled
/etc/init.d/lanports enabled
/etc/init.d/hosts_scan enabled
/etc/init.d/telegram_bot start
/etc/init.d/lanports start
/etc/init.d/hosts_scan start
fi
exit 0
endef
define Package/telegram-openwrt/prerm
#!/bin/sh
if [ -n "$${IPKG_INSTROOT}" ]; then
/etc/init.d/telegram_bot stop
/etc/init.d/lanports stop
/etc/init.d/hosts_scan stop
/etc/init.d/telegram_bot disable
/etc/init.d/lanports disable
/etc/init.d/hosts_scan disable
fi
exit 0
endef
$(eval $(call BuildPackage,telegram-openwrt))