Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
woniuzfb committed Jul 27, 2021
1 parent 6a28862 commit ac22115
Show file tree
Hide file tree
Showing 4 changed files with 285 additions and 85 deletions.
100 changes: 45 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#

``` bash
tv c <en|zh_CN|...> # change/update language
```
`tv c <en|zh_CN|...>` change/update language

## 目录

- [目录](#目录)
- [一键管理 v2ray 脚本](#一键管理-v2ray-脚本)
- [一键管理 xray 脚本](#一键管理-xray-脚本)
- [一键管理 nginx 脚本](#一键管理-nginx-脚本)
- [一键管理 openresty 脚本](#一键管理-openresty-脚本)
- [一键管理 xray 脚本](#一键管理-xray-脚本)
- [一键管理 v2ray 脚本](#一键管理-v2ray-脚本)
- [一键管理 armbian 脚本](#一键管理-armbian-脚本)
- [一键管理 proxmox ve 脚本](#一键管理-proxmox-ve-脚本)
- [一键管理 ibm cloud foundry 脚本](#一键管理-ibm-cloud-foundry-脚本)
Expand All @@ -25,63 +23,63 @@ tv c <en|zh_CN|...> # change/update language
- [参数详解](#参数详解)
- [举例](#举例)

## 一键管理 nginx 脚本
## 一键管理 v2ray 脚本

``` bash
wget -q https://woniuzfb.github.io/iptv/nx.sh && bash nx.sh

nx # 打开 Nginx 管理面板
wget https://woniuzfb.github.io/iptv/v2.sh && bash v2.sh

```

- 使用官方 crossplane 解析配置
- 支持修改最多五级指令
- SNI/SSL/APLN 分流
`v2` 打开 v2ray 管理面板

---

## 一键管理 openresty 脚本
## 一键管理 xray 脚本

``` bash
wget -q https://woniuzfb.github.io/iptv/or.sh && bash or.sh

or # 打开 OpenResty 管理面板
wget https://woniuzfb.github.io/iptv/x.sh && bash x.sh

```

`x` 打开 xray 管理面板

---

## 一键管理 xray 脚本
## 一键管理 nginx 脚本

``` bash
wget -q https://woniuzfb.github.io/iptv/x.sh && bash x.sh

x # 打开 xray 管理面板
wget https://woniuzfb.github.io/iptv/nx.sh && bash nx.sh

```

`nx` 打开 Nginx 管理面板

- 使用官方 crossplane 解析配置
- 支持修改最多五级指令
- SNI/SSL/APLN 分流

---

## 一键管理 v2ray 脚本
## 一键管理 openresty 脚本

``` bash
wget -q https://woniuzfb.github.io/iptv/v2.sh && bash v2.sh

v2 # 打开 v2ray 管理面板
wget https://woniuzfb.github.io/iptv/or.sh && bash or.sh

```

`or` 打开 OpenResty 管理面板

---

## 一键管理 armbian 脚本

``` bash
wget -q https://woniuzfb.github.io/iptv/arm.sh && bash arm.sh

arm # 打开 Armbian 管理面板
wget https://woniuzfb.github.io/iptv/arm.sh && bash arm.sh

```

`arm` 打开 Armbian 管理面板

- docker
- dnscrypt proxy
- openwrt (旁路由)
Expand All @@ -95,12 +93,12 @@ arm # 打开 Armbian 管理面板
## 一键管理 proxmox ve 脚本

``` bash
wget -q https://woniuzfb.github.io/iptv/pve.sh && bash pve.sh

pve # 打开 Proxmox VE 管理面板
wget https://woniuzfb.github.io/iptv/pve.sh && bash pve.sh

```

`pve` 打开 Proxmox VE 管理面板

- nbfc
- dnscrypt proxy
- openwrt-v2ray
Expand All @@ -112,28 +110,28 @@ pve # 打开 Proxmox VE 管理面板
## 一键管理 ibm cloud foundry 脚本

``` bash
wget -q https://woniuzfb.github.io/iptv/ibm.sh && bash ibm.sh
wget https://woniuzfb.github.io/iptv/ibm.sh && bash ibm.sh

ibm # 打开 ibm CF 管理面板
```

ibm v2 # 打开 ibm v2ray APP 管理面板
`ibm` 打开 ibm CF 管理面板

ibm x # 打开 ibm xray APP 管理面板
`ibm v2` 打开 ibm v2ray APP 管理面板

```
`ibm x` 打开 ibm xray APP 管理面板

---

## 一键管理 cloudflare partner,workers 脚本

``` bash
wget -q https://woniuzfb.github.io/iptv/cf.sh && bash cf.sh
wget https://woniuzfb.github.io/iptv/cf.sh && bash cf.sh

cf # 打开 cloudflare partner,workers 管理面板
```

cf w # 打开 cloudflare workers 管理面板
`cf` 打开 cloudflare partner,workers 管理面板

```
`cf w` 打开 cloudflare workers 管理面板

Mac/Linux 一键获取最优 IP 可以用脚本 [cloudflare-fping](https://github.com/woniuzfb/cloudflare-fping)

Expand All @@ -155,18 +153,18 @@ Mac/Linux 一键获取最优 IP 可以用脚本 [cloudflare-fping](https://githu
### [演示](https://mtime.info/)

``` bash
wget -q https://woniuzfb.github.io/iptv/iptv.sh && bash iptv.sh
wget https://woniuzfb.github.io/iptv/iptv.sh && bash iptv.sh

tv # 打开 iptv 管理面板
```

`tv` 打开 iptv 管理面板

始终用最新的脚本,升级方式

- 管理面板(推荐)
- 用这里的 iptv.sh 覆盖 /usr/local/bin/tv ,删除主目录 /usr/local/iptv 下的 lock 文件

```

### 编译 h265 patched 静态 FFmpeg

``` bash
Expand All @@ -178,13 +176,9 @@ docker run -it ffmpeg-h265-static

### 自动解析直播源

``` bash
tv 4g # 打开 4gtv 频道管理面板
```
`tv 4g` 打开 4gtv 频道管理面板

``` bash
tv d # 添加演示频道
```
`tv d` 添加演示频道

- tvb
- fengshows
Expand All @@ -194,15 +188,11 @@ tv d # 添加演示频道

### xtream codes 频道

``` bash
cx # 打开 Xtream Codes 账号/频道 管理面板
```
`cx` 打开 Xtream Codes 账号/频道 管理面板

### VIP 频道

``` bash
tv v # 直接打开 VIP 频道面板
```
`tv v` 直接打开 VIP 频道面板

- IP 控制
- 自带 m3u, epg
Expand Down
125 changes: 115 additions & 10 deletions docs/iptv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41930,21 +41930,126 @@ then
VimConfig
;;
3)
Println "$tip 此选项主要用于笔记本"
bootloader_options=( Grub Systemd-boot )
inquirer list_input "选择当前引导程序" bootloader_options bootloader

echo
monitor_options=( '关闭显示器' '取消关闭显示器' )
inquirer list_input "选择操作" monitor_options monitor_option
monitor_options=( '自动关闭显示器' '取消自动关闭显示器' )
inquirer list_input_index "选择操作" monitor_options monitor_options_index

if [ "$monitor_option" == "关闭显示器" ]
if [ "$monitor_options_index" -eq 0 ]
then
echo
inquirer text_input "输入多少秒后关闭显示器" console_blank_secs 120
inquirer text_input "输入多少秒后自动关闭显示器" console_blank_secs 120

if [ "$bootloader" == "Grub" ]
then
. /etc/default/grub

if grep -q "consoleblank=" <<< "$GRUB_CMDLINE_LINUX_DEFAULT"
then
cmdline=($GRUB_CMDLINE_LINUX_DEFAULT)
GRUB_CMDLINE_LINUX_DEFAULT=""
for ele in "${cmdline[@]}"
do
[ -n "$GRUB_CMDLINE_LINUX_DEFAULT" ] && GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT "
if [ "${ele%=*}" == "consoleblank" ]
then
GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT}consoleblank=$console_blank_secs"
else
GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT$ele"
fi
done
elif [ -n "$GRUB_CMDLINE_LINUX_DEFAULT" ]
then
GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT consoleblank=$console_blank_secs"
else
GRUB_CMDLINE_LINUX_DEFAULT="consoleblank=$console_blank_secs"
fi

sed -i '0,/GRUB_CMDLINE_LINUX=""/s//GRUB_CMDLINE_LINUX="consoleblank='"$console_blank_secs"'"/' /etc/default/grub
sed -i '0,/GRUB_CMDLINE_LINUX_DEFAULT=.*/s//GRUB_CMDLINE_LINUX_DEFAULT="'"$GRUB_CMDLINE_LINUX_DEFAULT"'"/' /etc/default/grub
update-grub

Println "$info 设置成功\n"

exit 0
fi

if [ ! -s /etc/kernel/cmdline ]
then
echo -n "consoleblank=$console_blank_secs" >> /etc/kernel/cmdline
elif ! grep -q "consoleblank=" < /etc/kernel/cmdline
then
echo -n "$(< /etc/kernel/cmdline) consoleblank=$console_blank_secs" > /etc/kernel/cmdline
else
line=$(< /etc/kernel/cmdline)
cmdline=($line)
SYS_CMDLINE=""
for ele in "${cmdline[@]}"
do
[ -n "$SYS_CMDLINE" ] && SYS_CMDLINE="$SYS_CMDLINE "
if [ "${ele%=*}" == "consoleblank" ]
then
SYS_CMDLINE="${SYS_CMDLINE}consoleblank=$console_blank_secs"
else
SYS_CMDLINE="$SYS_CMDLINE$ele"
fi
done
echo -n "$SYS_CMDLINE" > /etc/kernel/cmdline
fi
else
sed -i '0,/GRUB_CMDLINE_LINUX=.*/s//GRUB_CMDLINE_LINUX=""/' /etc/default/grub
if [ "$bootloader" == "Grub" ]
then
. /etc/default/grub

if ! grep -q "consoleblank=" <<< "$GRUB_CMDLINE_LINUX_DEFAULT"
then
Println "$error 无需操作\n"
exit 1
fi

cmdline=($GRUB_CMDLINE_LINUX_DEFAULT)
GRUB_CMDLINE_LINUX_DEFAULT=""
for ele in "${cmdline[@]}"
do
[ -n "$GRUB_CMDLINE_LINUX_DEFAULT" ] && GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT "
if [ "${ele%=*}" == "consoleblank" ]
then
continue
fi
GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT$ele"
done

sed -i '0,/GRUB_CMDLINE_LINUX_DEFAULT=.*/s//GRUB_CMDLINE_LINUX_DEFAULT="'"$GRUB_CMDLINE_LINUX_DEFAULT"'"/' /etc/default/grub
update-grub

Println "$info 设置成功\n"
exit 0
fi

if [ ! -s /etc/kernel/cmdline ] || ! grep -q "consoleblank=" < /etc/kernel/cmdline
then
Println "$error 无需操作\n"
exit 1
fi

line=$(< /etc/kernel/cmdline)
cmdline=($line)
SYS_CMDLINE=""
for ele in "${cmdline[@]}"
do
[ -n "$SYS_CMDLINE" ] && SYS_CMDLINE="$SYS_CMDLINE "
if [ "${ele%=*}" == "consoleblank" ]
then
continue
fi
SYS_CMDLINE="$SYS_CMDLINE$ele"
done
echo -n "$SYS_CMDLINE" > /etc/kernel/cmdline
fi

update-grub
pve-efiboot-tool refresh

Println "$info 设置成功\n"
;;
Expand All @@ -41967,7 +42072,7 @@ then
5)
if [[ ! -x $(command -v mono) ]]
then
echo
Println "$tip 此选项主要用于笔记本"
AskIfContinue n "`gettext \"需要安装 mono, 耗时会很长, 是否继续\"`"

apt-get update
Expand Down Expand Up @@ -42220,7 +42325,7 @@ then

qm set $vm_id --agent 1

Println "$info 请在虚拟机内执行 opkg update; opkg install qemu-ga 后关闭虚拟机几秒后再打开\n\n如果是在国内, 可以在 openwrt 内执行下面命令加快 opkg 速度\n sed -i 's_http[s]*://downloads.openwrt.org_$FFMPEG_MIRROR_LINK/openwrt_' /etc/opkg/distfeeds.conf\n"
Println "$info 请在虚拟机内执行 opkg update; opkg install qemu-ga 后重启\n\n如果是在国内, 可以在 openwrt 内执行下面命令加快 opkg 速度\nsed -i 's_http[s]*://downloads.openwrt.org_$FFMPEG_MIRROR_LINK/openwrt_' /etc/opkg/distfeeds.conf\n"
;;
9)
ReleaseCheck
Expand All @@ -42241,7 +42346,7 @@ then
echo
qm guest exec $vm_id wget "$FFMPEG_MIRROR_LINK/pve/snippets/openwrt-v2ray-install.sh" -- "-O" "/root/openwrt-v2ray-install.sh" | $JQ_FILE -r '."err-data" // ."out-data"'

Println "$info 安装 openwrt-v2ray, 请稍等 ..."
Println "$info 正在安装 openwrt-v2ray, 请耐心等待 ..."

echo
qm guest exec $vm_id --timeout 0 ash "/root/openwrt-v2ray-install.sh" | $JQ_FILE -r '."err-data" // ."out-data"'
Expand Down
Loading

0 comments on commit ac22115

Please sign in to comment.