You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
2.1 KiB
86 lines
2.1 KiB
#!/bin/bash
|
|
|
|
set -e # exit on error
|
|
set -o pipefail # exit on pipeline error
|
|
set -u # treat unset variable as error
|
|
|
|
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
|
|
|
|
$APT_CMD update >>$OUTPUT 2>&1
|
|
|
|
# install packages
|
|
if [ -f $SCRIPT_DIR/$PACKAGE_VARIANT.list ]; then
|
|
$APT_CMD install $APT_OPTIONS \
|
|
$(grep -vE "^\s*#" $SCRIPT_DIR/$PACKAGE_VARIANT.list | tr "\n" " ") >>$OUTPUT 2>&1
|
|
fi
|
|
|
|
cat >/etc/samba/smb.conf <<'EOF'
|
|
[global]
|
|
dos charset = cp866
|
|
server string = Samba Server
|
|
unix charset = UTF8
|
|
log file = /var/log/samba/%m.log
|
|
max log size = 50
|
|
disable spoolss = Yes
|
|
load printers = No
|
|
printcap name = /dev/null
|
|
show add printer wizard = No
|
|
unix extensions = No
|
|
map to guest = Bad User
|
|
security = USER
|
|
dns proxy = No
|
|
idmap config * : backend = tdb
|
|
wide links = Yes
|
|
[media]
|
|
comment = Media Folder
|
|
path = /mediasource
|
|
locking = No
|
|
read only = No
|
|
valid users = guest
|
|
EOF
|
|
|
|
cat >/lib/systemd/system/x11vnc.service <<'EOF'
|
|
[Unit]
|
|
Description=Start x11vnc at startup.
|
|
After=multi-user.target
|
|
[Service]
|
|
Type=simple
|
|
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
|
|
cat >/lib/systemd/system/novnc.service <<'EOF'
|
|
[Unit]
|
|
Description=NoVNC
|
|
After=network.target
|
|
[Service]
|
|
Type=simple
|
|
User=novnc
|
|
WorkingDirectory=/usr/share/novnc
|
|
ExecStart=/usr/bin/websockify --web /usr/share/novnc/ :6080 127.0.0.1:5900
|
|
#ExecStart=/usr/share/novnc/utils/launch.sh
|
|
Restart=on-abort
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
|
|
cat >/mediaplayer.config <<'EOF'
|
|
x11vnc_password=P1ayMyVide0
|
|
samba_password=P1ayMyVide0
|
|
vlc_password=P1ayMyVide0
|
|
nextcloud_password=P1ayMyVide0
|
|
media_source="mediasource"
|
|
playing_source="playingsource"
|
|
local_source="localsource"
|
|
local_source_label="LOCALSOURCE"
|
|
vlc_name=cvlc
|
|
vlc_options=" -f -R --no-video-title --extraintf=http --http-password $vlc_password"
|
|
play_pause=1
|
|
EOF
|
|
|
|
chmod +x /usr/bin/mediaplayer
|
|
|
|
systemctl disable smbd
|
|
systemctl disable x11vnc
|
|
systemctl disable novnc
|
|
|