forked from esirplayground/AutoBuild-OpenWrt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
customize.sh
executable file
·47 lines (27 loc) · 1.9 KB
/
customize.sh
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
#!/bin/bash
#=================================================
# Description: DIY script
# Lisence: MIT
# Author: eSirPlayground
# Youtube Channel: https://goo.gl/fvkdwm
#=================================================
#1. Modify default IP
sed -i 's/192.168.1.1/10.10.0.233/g' openwrt/package/base-files/files/bin/config_generate
#2. Clear the login password
sed -i 's/$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.//g' openwrt/package/lean/default-settings/files/zzz-default-settings
#3. Replace with JerryKuKu’s Argon
#rm openwrt/package/lean/luci-theme-argon -rf
#echo "sed -i \"s/option command.*$/option command '\/usr\/libexec\/login.sh'/\" /etc/config/ttyd" >> openwrt/package/lean/default-settings/files/zzz-default-settings
#[ -f /etc/config/filebrowser ] && \
#echo "sed -i \"s/option executable_directory.*$/option executable_directory '\/usr\/bin'/\" /etc/config/filebrowser" >> openwrt/package/lean/default-settings/files/zzz-default-settings
sed -i '/exit 0/d' openwrt/package/lean/default-settings/files/zzz-default-settings
cat >> openwrt/package/lean/default-settings/files/zzz-default-settings <<EOL
sed -i "s%option command.*$%option command '/usr/libexec/login.sh'%" /etc/config/ttyd
sed -i 's/"admin", "services"/"admin", "vpn"/' /usr/lib/lua/luci/model/cbi/openvpn.lua
sed -i 's/"admin", "services"/"admin", "vpn"/' /usr/lib/lua/luci/controller/openvpn.lua
sed -i 's/"admin", "services"/"admin", "vpn"/' /usr/lib/lua/luci/view/openvpn/pageswitch.htm
sed -i 's%admin/services%admin/vpn%' /usr/lib/lua/luci/view/openvpn/pageswitch.htm
sed -i '/Kernel Version/a<tr><td width="33%"><%:CPU Temperature%></td><td><%=luci.sys.exec("cut -c1-2 \/sys\/class\/thermal\/thermal_zone0\/temp")%>℃</td></tr>' /usr/lib/lua/luci/view/admin_status/index.htm
EOL
echo >> openwrt/package/lean/default-settings/files/zzz-default-settings
echo "exit 0" >> openwrt/package/lean/default-settings/files/zzz-default-settings