apt-get update apt-get install -y libimobiledevice-utils usb-modeswitch usb-modeswitch-data #安装无线配置依赖软件 #sudo apt-get install wpasupplicant #安装网页ssh依赖软件 apt-get install -y shellinabox echo "Configuring Shell in a Box..." sed -i '/SHELLINABOX_PORT=/c SHELLINABOX_PORT=2222' /etc/default/shellinabox sed -i '/SHELLINABOX_ARGS=/c SHELLINABOX_ARGS="--no-beep --disable-ssl-menu --disable-ssl --css=/etc/shellinabox/options-enabled/00_White\\ On\\ Black.css"' /etc/default/shellinabox rm -rf /etc/shellinabox/options-enabled/00+Black\ on\ White.css rm -rf /etc/shellinabox/options-enabled/01_Monochrome.css systemctl enable shellinabox systemctl start shellinabox systemctl restart shellinabox #设置pi-starAP及需要软件 apt-get install -y hostapd dnsmasq systemctl daemon-reload systemctl disable hostapd systemctl disable dnsmasq echo 'DAEMON_CONF="/etc/hostapd/hostapd.conf"' >> /etc/default/hostapd echo 'interface=wlan0_ap' > /etc/hostapd/hostapd.conf echo 'ssid=Pi-Star' >> /etc/hostapd/hostapd.conf echo 'hw_mode=g' >> /etc/hostapd/hostapd.conf echo 'macaddr_acl=0' >> /etc/hostapd/hostapd.conf echo 'auth_algs=1' >> /etc/hostapd/hostapd.conf echo 'ignore_broadcast_ssid=0' >> /etc/hostapd/hostapd.conf echo 'channel=6' >> /etc/hostapd/hostapd.conf echo 'wpa=2' >> /etc/hostapd/hostapd.conf echo 'wpa_passphrase=raspberry' >> /etc/hostapd/hostapd.conf echo 'wpa_key_mgmt=WPA-PSK' >> /etc/hostapd/hostapd.conf echo 'wpa_pairwise=TKIP' >> /etc/hostapd/hostapd.conf echo 'rsn_pairwise=CCMP' >> /etc/hostapd/hostapd.conf echo '' >> /etc/network/interfaces echo 'iface wlan0_ap inet static' >> /etc/network/interfaces echo ' hwaddress ether b8:27:eb:00:00:01' >> /etc/network/interfaces echo ' address 192.168.50.1' >> /etc/network/interfaces echo ' netmask 255.255.255.0' >> /etc/network/interfaces echo ' network 192.168.50.0' >> /etc/network/interfaces echo ' broadcast 192.168.50.255' >> /etc/network/interfaces echo 'interface=lo,wlan0_ap' > /etc/dnsmasq.conf echo 'server=208.67.222.123' >> /etc/dnsmasq.conf echo 'server=208.67.220.123' >> /etc/dnsmasq.conf echo 'domain-needed' >> /etc/dnsmasq.conf echo 'bogus-priv' >> /etc/dnsmasq.conf echo 'dhcp-authoritative' >> /etc/dnsmasq.conf echo 'dhcp-range=192.168.50.50,192.168.50.99,4h' >> /etc/dnsmasq.conf echo 'dhcp-option=1,255.255.255.0' >> /etc/dnsmasq.conf echo 'dhcp-option=3,192.168.50.1' >> /etc/dnsmasq.conf echo 'dhcp-option=6,192.168.50.1' >> /etc/dnsmasq.conf #安装防火墙依赖软件 apt-get install iptables miniupnpc #安装vnstat apt-get install vnstat systemctl stop vnstat.service rm -rf /var/lib/vnstat mkdir -p /var/lib/vnstat chown -R vnstat:vnstat /var/lib/vnstat echo "tmpfs /var/lib/vnstat tmpfs nodev,noatime,nosuid,mode=0755,size=64m 0 0" >> /etc/fstab mount /var/lib/vnstat chown -R vnstat:vnstat /var/lib/vnstat systemctl restart vnstat.service #安装gpsd apt-get install -y gpsd libgps28 systemctl disable gpsd.service systemctl disable gpsd.socket systemctl mask gpsd.service systemctl mask gpsd.socket #安装python sudo apt install python -y sudo ln -fs /usr/bin/python2.7 /usr/bin/python #安装 systemd-timesyncd apt-get -qq remove -y --purge ntp apt-get -qq autoremove -y apt-get -qq install -y systemd-timesyncd #安装编译需要的依赖 sudo apt install git build-essential zsh nmap lsof vim cmake gcc-arm-none-eabi stm32flash libusb-1.0-0-dev libasound2-dev libwxgtk3.0-gtk3-dev libgps-dev libusb-dev #创建服务需要用户及文件 sudo adduser -s /bin/bash -m mmdvm -d /home/mmdvm sudo groupadd mmdvm usermod mmdvm -G mmdvm usermod mmdvm -G dialout echo "pi-star ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers echo "www-data ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers mkdir -p /var/log/pi-star echo "tmpfs /var/log/pi-star tmpfs nodev,noatime,nosuid,mode=0755,size=64m 0 0" >> /etc/fstab mount /var/log/pi-star mkdir -p /var/log/pi-star chown -R mmdvm:mmdvm /var/log/pi-star #编译二进制文件 mkdir -p $HOME/dev cd $HOME/dev git clone https://gitee.com/bh3frk/wpsd_-custom-binaries-source.git cd $HOME/dev/WPSD_CustomBinaries-Source ./build-all.sh cp -p $HOME/dev/W0CHP-PiStar-bin/* /usr/local/bin/ #设置systemd服务 cp $HOME/dev/WPSD_CustomBinaries-Source/systemd/* /usr/lib/systemd/systemd/ sudo systemctl daemon-reload systemctl enable --now aprsgateway.service systemctl enable --now aprsgateway.timer systemctl enable --now dgidgateway.service systemctl enable --now dgidgateway.timer systemctl enable --now dapnetgateway.timer systemctl enable --now dapnetgateway.timer systemctl enable --now dmr2nxdn.service systemctl enable --now dmr2nxdn.timer systemctl enable --now dmr2ysf.service systemctl enable --now dmr2ysf.timer systemctl enable --now dstarrepeater.service systemctl enable --now dstarrepeater.timer systemctl enable --now ircddbgateway.service systemctl enable --now ircddbgateway.timer systemctl enable --now mmdvmhost.service systemctl enable --now mmdvm-log-shutdown.service systemctl enable --now mmdvm-log-backup.service systemctl enable --now mmdvm-log-restore.service systemctl enable --now mmdvmhost.timer systemctl enable --now mmdvm-log-backup.timer systemctl enable --now mmdvm-log-restore.timer systemctl enable --now m17gateway.service systemctl enable --now m17gateway.timer systemctl enable --now nxdngateway.service systemctl enable --now nxdnparrot.service systemctl enable --now nxdngateway.timer systemctl enable --now nxdnparrot.timer systemctl enable --now p25gateway.service systemctl enable --now p25parrot.service systemctl enable --now p25gateway.timer systemctl enable --now p25parrot.timer systemctl enable --now pistar-remote.service systemctl enable --now pistar-upnp.service systemctl enable --now pistar-watchdog.service systemctl enable --now pistar-ap.timer systemctl enable --now pistar-remote.timer systemctl enable --now pistar-upnp.timer systemctl enable --now pistar-watchdog.timer systemctl enable --now timercontrol.service systemctl enable --now timeserver.service systemctl enable --now timercontrol.timer systemctl enable --now timeserver.timer systemctl enable --now ysf2dmr.service systemctl enable --now ysf2nxdn.service systemctl enable --now ysf2p25.service systemctl enable --now ysfgateway.service systemctl enable --now ysfparrot.service systemctl enable --now ysfgateway.timer systemctl enable --now ysfparrot.timer systemctl enable --now ysf2dmr.timer systemctl enable --now ysf2nxdn.timer systemctl enable --now ysf2p25.timer systemctl enable --now nextiondriver.service #下载usr/local/sbin文件 git clone --recursive https://gitee.com/bh3frk/w0-chp-pi-star-sbin.git /usr/local/sbin sudo chmod -R 755 /usr/local/sbin #安装nginx sudo apt-get install -y nginx #安装php及扩展插件 apt-get install -y php php-cli php-common php-fpm php-json php-mbstring php-opcache php-readline php-zip #下载W0CHP-PiStar-Dash git clone --recursive https://gitee.com/bh3frk/W0CHP-PiStar-Dash.git /var/www/dashboard sudo chown -R www-data:www-data /var/www/dashboard sudo chmod -R 755 /var/www/dashboard