Compare commits

...
25 Commits
Author SHA1 Message Date
Mr Chen 6062699074 Merge pull request #406 from midoks/dev
0.14.3
2023-05-05 20:52:04 +08:00
midoks df9d57ba70 Update README.md 2023-05-05 20:50:20 +08:00
midoks ffca953539 up 2023-05-05 20:49:45 +08:00
midoks bd4946124f Update install.sh 2023-05-05 18:21:10 +08:00
midoks 8e18c63cee up 2023-05-05 17:52:13 +08:00
midoks d201ca2574 Update install_dev.sh 2023-05-05 17:51:09 +08:00
midoks b644f91090 安装时curl库软连接修复 2023-05-05 16:59:47 +08:00
midoks 931f51cf59 Update client_ad.py 2023-05-05 14:12:14 +08:00
midoks 0909a11fd9 Update client_ad.py 2023-05-05 14:03:45 +08:00
midoks 2ba2833699 Update client_ad.py 2023-05-05 13:59:14 +08:00
midoks 20389263fb Update client_ad.py 2023-05-04 20:41:10 +08:00
midoks 86141ccf3a Update my5.7.cnf 2023-05-04 16:42:59 +08:00
midoks b2fdf84ca0 Update index.py 2023-05-04 16:39:46 +08:00
midoks 8fbc456e1a Update my5.7.cnf 2023-05-04 13:19:21 +08:00
midoks 4e43382496 Update client_ad.py 2023-05-03 18:29:37 +08:00
midoks 0326d4f112 Update client_ad.py 2023-05-03 18:05:33 +08:00
midoks a87c13c5e0 Update client_ad.py 2023-05-03 13:02:21 +08:00
midoks 5f3720c855 Update client_ad.py 2023-05-03 12:50:41 +08:00
midoks f548e020c4 up 2023-05-03 12:33:56 +08:00
midoks 7f21781c0b Update tgclient.py 2023-05-03 12:33:01 +08:00
midoks 680b0f09f2 Update client_ad.py 2023-05-03 12:22:31 +08:00
midoks 482943a63c Update client_ad.py 2023-05-03 10:53:49 +08:00
midoks 2871aee18e Create client_ad.py 2023-05-03 10:53:18 +08:00
midoks ff46d9b36e up 2023-05-02 21:39:18 +08:00
midoks fd5fcba543 up 2023-05-02 13:25:07 +08:00
17 changed files with 194 additions and 101 deletions
+3 -4
View File
@@ -99,11 +99,10 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
```
### 版本更新 0.14.2
### 版本更新 0.14.3
* 加入TgClient插件
* 网站防篡改程序(测试中)
* Docker(测试中)
* 安装优化,针对oracle中的curl库优化。
* PHP的Composer安装优化。
### JSDelivr安装地址
+1 -1
View File
@@ -27,7 +27,7 @@ from flask import request
class config_api:
__version = '0.14.2'
__version = '0.14.3'
__api_addr = 'data/api.json'
def __init__(self):
+2 -1
View File
@@ -17,6 +17,7 @@ datadir = {$SERVER_APP_PATH}/data
log-error = {$SERVER_APP_PATH}/data/error.log
server-id = {$SERVER_ID}
explicit_defaults_for_timestamp=true
default_storage_engine = InnoDB
@@ -95,7 +96,7 @@ innodb_file_per_table = 1
innodb_large_prefix = 1
secure-file-priv={$SERVER_APP_PATH}/tmp
#secure-file-priv=disabled
[mysqldump]
quick
+1 -1
View File
@@ -383,7 +383,7 @@ def initMysql57Data():
myconf = serverdir + "/etc/my.cnf"
user = pGetDbUser()
cmd = 'cd ' + serverdir + ' && ./bin/mysqld --defaults-file=' + myconf + \
' --initialize-insecure --explicit_defaults_for_timestamp'
' --initialize-insecure --explicit_defaults_for_timestamp --user=mysql'
data = mw.execShell(cmd)
# print(data)
return False
-1
View File
@@ -72,7 +72,6 @@ if [ "${action}" == "install" ] && [ -d ${serverPath}/php/${type} ];then
cd ${rootPath}/plugins/php/versions/common && bash gettext.sh install ${type}
cd ${rootPath}/plugins/php/versions/common && bash redis.sh install ${type}
cd ${rootPath}/plugins/php/versions/common && bash memcached.sh install ${type}
cd ${rootPath}/plugins/php/versions/common && bash zlib.sh install ${type}
if [ "${type}" -gt "72" ];then
cd ${rootPath}/plugins/php/versions/common && bash zip.sh install ${type}
-7
View File
@@ -44,15 +44,8 @@ def send_msg(bot, tag='ad', trigger_time=300):
# https://t.me/gjgzs2022 | 19/m
# ♻️CMS导航网♻️/💰流量变现💰 | 28/m
# CK资源采集 |29/m
# 高防服务器CDN请联系玥玥 |3/m
# https://zhaoziyuan.la/ | 15/m | 2m | next,5/15
keyboard = [
[
types.InlineKeyboardButton(
text="海外服务器高防CDN请联系玥玥", url='https://t.me/CDNYUEYUE')
],
[
types.InlineKeyboardButton(
text="CK资源采集", url='https://ckzy1.com/')
@@ -43,12 +43,7 @@ def send_msg(bot, tag='ad', trigger_time=300):
# https://t.me/gjgzs2022 | 19/m
# ♻️CMS导航网♻️/💰流量变现💰 | 28/m
# CK资源采集 |29/m
# 高防服务器CDN请联系玥玥 |3/m
keyboard = [
[
types.InlineKeyboardButton(
text="海外服务器高防CDN请联系玥玥", url='https://t.me/CDNYUEYUE')
],
[
types.InlineKeyboardButton(
text="CK资源采集", url='https://ckzy1.com/')
@@ -0,0 +1,90 @@
# coding:utf-8
# func: 在其他发送推送AD
# url: https://docs.telethon.dev/en/stable/modules/client.html
import sys
import io
import os
import time
import re
import json
import base64
import threading
import asyncio
sys.path.append(os.getcwd() + "/class/core")
import mw
from telethon import utils
from telethon import functions, types
from telethon.tl.functions.messages import AddChatUserRequest
from telethon.tl.functions.channels import InviteToChannelRequest
# 指定群ID
chat_id_list = [-1001578009023]
filter_g_id = [-1001771526434]
msg_ad = "本人软件推广(30s)\n\n"
msg_ad += "开源地址(Linux面板) mdserver-web,站长必备,不收费,无毒。源码为证。全靠TG乞讨! \n"
msg_ad += "看个人简介,加入群聊,一起进步!\n"
# msg_ad += "https://github.com/midoks/mdserver-web \n"
# msg_ad += "\n"
# msg_ad += "加入群聊,一起进步! \n"
# msg_ad += "https://t.me/mdserver_web \n"
# msg_ad += "不收费,无毒。源码为证。全靠TG乞讨!😭\n\n"
# msg_ad += "捐赠地址 USDT(TRC20)\n"
# msg_ad += "TVbNgrpeGBGZVm5gTLa21ADP7RpnPFhjya\n"
# msg_ad += "日行一善,以后必定大富大贵\n"
async def writeLog(log_str):
if __name__ == "__main__":
print(log_str)
now = mw.getDateFromNow()
log_file = mw.getServerDir() + '/tgclient/task.log'
mw.writeFileLog(now + ':' + log_str, log_file, limit_size=5 * 1024)
return True
async def send_msg(client, chat_id, tag='ad', trigger_time=600):
# 信号只在一个周期内执行一次|start
lock_file = mw.getServerDir() + '/tgclient/lock.json'
if not os.path.exists(lock_file):
mw.writeFile(lock_file, '{}')
lock_data = json.loads(mw.readFile(lock_file))
if tag in lock_data:
diff_time = time.time() - lock_data[tag]['do_time']
if diff_time >= trigger_time:
lock_data[tag]['do_time'] = time.time()
else:
return False, 0, 0
else:
lock_data[tag] = {'do_time': time.time()}
mw.writeFile(lock_file, json.dumps(lock_data))
# 信号只在一个周期内执行一次|end
msg = await client.send_message(chat_id, msg_ad)
await asyncio.sleep(30)
await client.delete_messages(chat_id, msg)
await asyncio.sleep(3)
async def run(client):
client.parse_mode = 'html'
# for chat_id in chat_id_list:
# await send_msg(client, chat_id)
# await asyncio.sleep(30)
info = await client.get_dialogs()
for chat in info:
if chat.is_group and not chat.id in filter_g_id:
# print(chat)
await writeLog('name:{0} id:{1} is_user:{2} is_channel:{3} is_group:{4}'.format(
chat.name, chat.id, chat.is_user, chat.is_channel, chat.is_group))
try:
await send_msg(client, chat.id, 'ad_' + str(chat.id))
except Exception as e:
await writeLog(str(e))
if __name__ == "__main__":
pass
@@ -24,21 +24,20 @@ from telebot.util import quick_markup
chat_id_list = [-1001578009023, -1001979545570]
async def run(client):
while True:
for chat_id in chat_id_list:
s = await client.send_message(chat_id, '开始自动检测已经注销群成员...')
count = 0
async for user in client.iter_participants(chat_id):
if user.deleted:
count += 1
msg = await client.kick_participant(chat_id, user)
for chat_id in chat_id_list:
s = await client.send_message(chat_id, '开始自动检测已经注销群成员...')
count = 0
async for user in client.iter_participants(chat_id):
if user.deleted:
count += 1
msg = await client.kick_participant(chat_id, user)
await client.edit_message(chat_id, s.id, '已经检测到有(%d)个账户已失效' % (count))
await asyncio.sleep(3)
await client.edit_message(chat_id, s.id, '自动检测已经注销群成员完毕!!!')
await asyncio.sleep(3)
await client.delete_messages(chat_id, s)
await asyncio.sleep(300)
await client.edit_message(chat_id, s.id, '已经检测到有(%d)个账户已失效' % (count))
await asyncio.sleep(3)
await client.edit_message(chat_id, s.id, '自动检测已经注销群成员完毕!!!')
await asyncio.sleep(3)
await client.delete_messages(chat_id, s)
await asyncio.sleep(300)
if __name__ == "__main__":
@@ -22,36 +22,34 @@ from telethon.tl.functions.channels import InviteToChannelRequest
# 指定群ID
chat_id = -1001979545570
filter_user_id = 5568699210
filter_g_id = [-1001771526434]
async def run(client):
while True:
info = await client.get_dialogs()
for chat in info:
print('name:{0} ids:{1} is_user:{2} is_channel:{3} is_group:{4}'.format(
chat.name, chat.id, chat.is_user, chat.is_channel, chat.is_group))
if chat.is_group and chat.id != chat_id:
list_user = []
async for user in client.iter_participants(chat.id):
# print(chat.id, user.id, user.first_name)
if filter_user_id != user.id and user.username != None and user.bot == False:
# print(user.first_name)
list_user.append(user.username)
# await client(AddChatUserRequest(
# chat_id=chat_id, # chat_id
# user_id=user.username, # 被邀请人id
# fwd_limit=1000 # Allow the user to see the 10 last messages
# ))
# print(list_user)
try:
await client(InviteToChannelRequest(
channel=chat_id, # chat_id
users=list_user, # 被邀请人id
))
except Exception as e:
print(str(e))
info = await client.get_dialogs()
for chat in info:
is_sleep = True
print('name:{0} id:{1} is_user:{2} is_channel:{3} is_group:{4}'.format(
chat.name, chat.id, chat.is_user, chat.is_channel, chat.is_group))
if chat.is_group and chat.id != chat_id:
list_user = []
async for user in client.iter_participants(chat.id):
if chat.id in filter_g_id:
is_sleep = False
continue
await asyncio.sleep(80000)
await asyncio.sleep(80000)
if filter_user_id != user.id and user.username != None and user.bot == False:
list_user.append(user.username)
print(list_user)
try:
await client(InviteToChannelRequest(
channel=chat_id, # chat_id
users=list_user, # 被邀请人id
))
except Exception as e:
print(str(e))
if is_sleep:
await asyncio.sleep(90000)
if __name__ == "__main__":
pass
+10 -2
View File
@@ -12,7 +12,10 @@ import asyncio
import logging
# python /Users/midoks/Desktop/mwdev/server/tgclient/tgclient.py
# cd /www/server/mdserver-web && python3 /www/server/tgclient/tgclient.py
'''
cd /www/server/mdserver-web && source bin/activate && python3 /www/server/tgclient/tgclient.py
'''
from telethon import TelegramClient
@@ -96,7 +99,7 @@ while True:
client = TelegramClient('mdioks', cfg['bot']['api_id'], cfg['bot']['api_hash'])
async def plugins_run():
async def plugins_run_task():
plist = getStartExtCfgByTag('client')
for p in plist:
try:
@@ -107,6 +110,11 @@ async def plugins_run():
writeLog(mw.getTracebackInfo())
writeLog('----- client error end -------')
async def plugins_run():
while True:
await plugins_run_task()
time.sleep(1)
async def main(loop):
await client.start()
+9 -9
View File
@@ -22,32 +22,32 @@ fi
if [ ${_os} == "Darwin" ]; then
OSNAME='macos'
elif grep -Eq "openSUSE" /etc/*-release; then
elif grep -Eqi "openSUSE" /etc/*-release; then
OSNAME='opensuse'
zypper refresh
zypper install cron wget curl zip unzip
elif grep -Eq "FreeBSD" /etc/*-release; then
elif grep -Eqi "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
elif grep -Eqi "CentOS" /etc/issue || grep -Eqi "CentOS" /etc/*-release; then
OSNAME='rhel'
yum install -y wget curl zip unzip tar crontabs
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
elif grep -Eqi "Fedora" /etc/issue || grep -Eqi "Fedora" /etc/*-release; then
OSNAME='fedora'
yum install -y wget curl zip unzip tar crontabs
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
elif grep -Eqi "Rocky" /etc/issue || grep -Eqi "Rocky" /etc/*-release; then
OSNAME='rhel'
yum install -y wget curl zip unzip tar crontabs
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eqi "AlmaLinux" /etc/*-release; then
OSNAME='rhel'
yum install -y wget curl zip unzip tar crontabs
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eqi "Amazon Linux" /etc/*-release; then
OSNAME='amazon'
yum install -y wget curl zip unzip tar crontabs
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/os-release; then
elif grep -Eqi "Debian" /etc/issue || grep -Eqi "Debian" /etc/os-release; then
OSNAME='debian'
apt update -y
apt install -y wget curl zip unzip tar cron
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/os-release; then
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eqi "Ubuntu" /etc/os-release; then
OSNAME='ubuntu'
apt update -y
apt install -y wget curl zip unzip tar cron
+6 -1
View File
@@ -188,7 +188,12 @@ fi
#https://blog.csdn.net/qq_36228377/article/details/123154344
# ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl
if [ ! -d /usr/include/curl ];then
ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl
SYS_ARCH=`arch`
if [ -f /usr/include/x86_64-linux-gnu/curl ];then
ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl
else
ln -s /usr/include/${SYS_ARCH}-linux-gnu/curl /usr/include/curl
fi
fi
apt install -y graphviz bison re2c flex libsqlite3-dev libonig-dev perl g++ libtool libxslt1-dev
+7 -1
View File
@@ -108,11 +108,17 @@ apt install -y libicu-dev
apt install -y build-essential
apt install -y libcurl4-openssl-dev
apt install -y libcurl4-nss-dev
apt install -y curl libcurl4-gnutls-dev
#https://blog.csdn.net/qq_36228377/article/details/123154344
# ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl
if [ ! -d /usr/include/curl ];then
ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl
SYS_ARCH=`arch`
if [ -f /usr/include/x86_64-linux-gnu/curl ];then
ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl
else
ln -s /usr/include/${SYS_ARCH}-linux-gnu/curl /usr/include/curl
fi
fi
+7 -7
View File
@@ -32,27 +32,27 @@ elif grep -Eq "openSUSE" /etc/*-release; then
zypper refresh
elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
elif grep -Eqi "CentOS" /etc/issue || grep -Eqi "CentOS" /etc/*-release; then
OSNAME='rhel'
yum install -y wget zip unzip
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
elif grep -Eqi "Fedora" /etc/issue || grep -Eqi "Fedora" /etc/*-release; then
OSNAME='fedora'
yum install -y wget zip unzip
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
elif grep -Eqi "Rocky" /etc/issue || grep -Eqi "Rocky" /etc/*-release; then
OSNAME='rhel'
yum install -y wget zip unzip
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eqi "AlmaLinux" /etc/*-release; then
OSNAME='rhel'
yum install -y wget zip unzip
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eqi "Amazon Linux" /etc/*-release; then
OSNAME='amazon'
yum install -y wget zip unzip
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
elif grep -Eqi "Debian" /etc/issue || grep -Eqi "Debian" /etc/*-release; then
OSNAME='debian'
apt update -y
apt install -y devscripts
apt install -y wget zip unzip
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eqi "Ubuntu" /etc/*-release; then
OSNAME='ubuntu'
apt install -y wget zip unzip
else
+10 -10
View File
@@ -22,33 +22,33 @@ fi
if [ ${_os} == "Darwin" ]; then
OSNAME='macos'
elif grep -Eq "openSUSE" /etc/*-release; then
elif grep -Eqi "openSUSE" /etc/*-release; then
OSNAME='opensuse'
zypper refresh
elif grep -Eq "FreeBSD" /etc/*-release; then
elif grep -Eqi "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
elif grep -Eqi "CentOS" /etc/issue || grep -Eqi "CentOS" /etc/*-release; then
OSNAME='centos'
yum install -y wget zip unzip
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
elif grep -Eqi "Fedora" /etc/issue || grep -Eqi "Fedora" /etc/*-release; then
OSNAME='fedora'
yum install -y wget zip unzip
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
elif grep -Eqi "Rocky" /etc/issue || grep -Eqi "Rocky" /etc/*-release; then
OSNAME='rocky'
yum install -y wget zip unzip
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eqi "AlmaLinux" /etc/*-release; then
OSNAME='alma'
yum install -y wget zip unzip
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eqi "Amazon Linux" /etc/*-release; then
OSNAME='amazon'
yum install -y wget zip unzip
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
elif grep -Eqi "Debian" /etc/issue || grep -Eqi "Debian" /etc/*-release; then
OSNAME='debian'
apt install -y wget zip unzip
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eqi "Ubuntu" /etc/*-release; then
OSNAME='ubuntu'
apt install -y wget zip unzip
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
elif grep -Eqi "Raspbian" /etc/issue || grep -Eqi "Raspbian" /etc/*-release; then
OSNAME='raspbian'
else
OSNAME='unknow'
+10 -10
View File
@@ -22,33 +22,33 @@ fi
if [ ${_os} == "Darwin" ]; then
OSNAME='macos'
elif grep -Eq "openSUSE" /etc/*-release; then
elif grep -Eqi "openSUSE" /etc/*-release; then
OSNAME='opensuse'
zypper refresh
elif grep -Eq "FreeBSD" /etc/*-release; then
elif grep -Eqi "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
elif grep -Eqi "CentOS" /etc/issue || grep -Eqi "CentOS" /etc/*-release; then
OSNAME='centos'
yum install -y wget zip unzip
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
elif grep -Eqi "Fedora" /etc/issue || grep -Eqi "Fedora" /etc/*-release; then
OSNAME='fedora'
yum install -y wget zip unzip
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
elif grep -Eqi "Rocky" /etc/issue || grep -Eqi "Rocky" /etc/*-release; then
OSNAME='rocky'
yum install -y wget zip unzip
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eqi "AlmaLinux" /etc/*-release; then
OSNAME='alma'
yum install -y wget zip unzip
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eqi "Amazon Linux" /etc/*-release; then
OSNAME='amazon'
yum install -y wget zip unzip
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
elif grep -Eqi "Debian" /etc/issue || grep -Eqi "Debian" /etc/*-release; then
OSNAME='debian'
apt install -y wget zip unzip
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eqi "Ubuntu" /etc/*-release; then
OSNAME='ubuntu'
apt install -y wget zip unzip
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
elif grep -Eqi "Raspbian" /etc/issue || grep -Eqi "Raspbian" /etc/*-release; then
OSNAME='raspbian'
else
OSNAME='unknow'