TEXT 模式
dialog, whiptail
X Window 模式
zenity, xdialog
/etc/X11/Xsession.options
/etc/X11/Xsession.d/
/etc/xdg/autostart
/usr/share/xfce4/panel/plugins
The Debian reference manual describes how the defaults work:
If the user has a ~/.xsessionrc file, read it.
If a specific session was selected in the DM (GDM, KDM, WDM, LightDM, ...) , run it.
Otherwise, if the user has a ~/.xsession or ~/.Xsession file, run it.
Otherwise, if the /usr/bin/x-session-manager command exists, run it.
Otherwise, if the /usr/bin/x-window-manager command exists, run it.
Otherwise, if the /usr/bin/x-terminal-emulator command exists, run it.
#安裝相關軟體
apt install -y iptables dnsmasq hostapd
export uap0=192.168.2.1/24
export dhcpr=192.168.2.2,192.168.88.50,12h
#設定網路界面
cat >/etc/network/interfaces.d/wlan0 <<EOF
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
EOF
cat >/etc/network/interfaces.d/uap0 <<EOF
iface uap0 inet static
address 192.168.2.1
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.1
EOF
#設定 dhcpd uap0 界面
echo >>dhcpcd.conf <<EOF
interface uap0
static ip_address=${uap0}
nohook wpa_supplicant
EOF
#設定 dnsmasq 服務
cat >>/etc/dnsmasq.conf <<EOF
interface=uap0
no-dhcp-interface=lo,wlan0
bind-interfaces
server=8.8.8.8
domain-needed
bogus-priv
dhcp-range=${dhcpr}
EOF
#設定 hostapd 服務
cat >/etc/hostapd/hostapd.conf <<EOF
interface=uap0
ssid=piap
hw_mode=g
channel=11
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
EOF
echo 'DAEMON_CONF="/etc/hostapd/hostapd.conf"' >>/etc/default/hostapd
systemctl unmask hostapd
#產生執行 script
cat >/root/startap.sh <<EOF
#!/bin/bash
# Create the virtual device
/sbin/iw dev wlan0 interface add uap0 type __ap
ifup uap0
# Route all the packets coming on this interface, this will enable #us to access internet through wlan0
sysctl net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 ! -d 192.168.2.0/24 -j MASQUERADE
systemctl start dnsmasq
systemctl start hostapd
EOF
apt-get install xfce4-clipman xfce4-goodies
編輯 /etc/locale.gen 增加
zh_TW.UTF-8 UTF-8
執行locale-gen
echo LANG=zh_TW.UTF-8 >>/etc/locale.conf
增加數值
/proc/sys/net/ipv4/neigh/default/gc_thresh1
/proc/sys/net/ipv4/neigh/default/gc_thresh2
/proc/sys/net/ipv4/neigh/default/gc_thresh3
echo "net.ipv4.neigh.default.gc_thresh1 = 512" >> /etc/sysctl.conf
echo "net.ipv4.neigh.default.gc_thresh2 = 2048" >> /etc/sysctl.conf
echo "net.ipv4.neigh.default.gc_thresh3 = 4096" >> /etc/sysctl.conf
sysctl -p