Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Config
Commits
51c7db5a
Commit
51c7db5a
authored
Apr 02, 2017
by
Igor Pecovnik
Browse files
Cleanup #1
parent
6a3e4b41
Changes
2
Hide whitespace changes
Inline
Side-by-side
functions.sh
View file @
51c7db5a
#!/bin/bash
#!/bin/bash
#
#
# (c) Igor Pecovnik
# (c) Igor Pecovnik
#
#
# Very basic stuff
# Very basic stuff
apt-get
-y
-qq
install
dialog whiptail lsb-release
apt-get
-y
-qq
install
dialog whiptail lsb-release
bc
# gather some info
# gather some info
distribution
=
$(
lsb_release
-cs
)
distribution
=
$(
lsb_release
-cs
)
...
@@ -15,14 +15,12 @@ set ${serverIP//./ }
...
@@ -15,14 +15,12 @@ set ${serverIP//./ }
SUBNET
=
"
$1
.
$2
.
$3
."
SUBNET
=
"
$1
.
$2
.
$3
."
hostnamefqdn
=
$(
hostname
-f
)
hostnamefqdn
=
$(
hostname
-f
)
mysql_pass
=
""
mysql_pass
=
""
tv_user
=
"admin"
backtitle
=
"Armbian post deployment scripts, http://www.armbian.com"
tv_pass
=
"1234"
backtitle
=
"Micro home server (c) Igor Pecovnik"
logfile
=
"/tmp/microhomeserver.log"
logfile
=
"/tmp/microhomeserver.log"
echo
"Start:"
>
$logfile
echo
"Start:"
>
$logfile
TTY_X
=
$((
$(
stty
size |
awk
'{print $2}'
)
-
6
))
# determine terminal width
TTY_X
=
$((
$(
stty
size |
awk
'{print $2}'
)
-
6
))
# determine terminal width
TTY_Y
=
$((
$(
stty
size |
awk
'{print $1}'
)
-
6
))
# determine terminal height
TTY_Y
=
$((
$(
stty
size |
awk
'{print $1}'
)
-
6
))
# determine terminal height
#distribution=$(lsb_release -i)" "$(lsb_release -cs)
#distribution=$(lsb_release -i)" "$(lsb_release -cs)
...
@@ -77,13 +75,12 @@ before_install ()
...
@@ -77,13 +75,12 @@ before_install ()
# What do we need anyway
# What do we need anyway
#--------------------------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------------------------------------
apt-get update | dialog
--backtitle
"
$backtitle
"
\
apt-get update | dialog
--backtitle
"
$backtitle
"
\
--progressbox
"Force package list update ..."
$TTY_Y
$TTY_X
--progressbox
"Force package list update ..."
$TTY_Y
$TTY_X
apt-get
-y
upgrade | dialog
--backtitle
"
$backtitle
"
\
apt-get
-y
upgrade | dialog
--backtitle
"
$backtitle
"
\
--progressbox
"Force upgrade ..."
$TTY_Y
$TTY_X
--progressbox
"Force upgrade ..."
$TTY_Y
$TTY_X
apt-get
-y
autoremove | dialog
--backtitle
"
$backtitle
"
\
apt-get
-y
autoremove | dialog
--backtitle
"
$backtitle
"
\
--progressbox
"Remove packages that are no more needed ..."
$TTY_Y
$TTY_X
--progressbox
"Remove packages that are no more needed ..."
$TTY_Y
$TTY_X
install_packet
"debconf-utils dnsutils unzip build-essential alsa-base alsa-utils stunnel4 html2text apt-transport-https"
\
install_packet
"debconf-utils unzip build-essential html2text apt-transport-https"
"Downloading basic packages"
"Downloading basic packages"
}
}
...
@@ -100,17 +97,18 @@ tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
...
@@ -100,17 +97,18 @@ tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
trap
"rm -f
$tempfile
"
0 1 2 5 15
trap
"rm -f
$tempfile
"
0 1 2 5 15
$DIALOG
--backtitle
"
$backtitle
"
\
$DIALOG
--backtitle
"
$backtitle
"
\
--title
"Installing to
$family
$distribution
"
--clear
--checklist
"
\n
Choose what you want to install:
\n
"
2
0
70 15
\
--title
"Installing to
$family
$distribution
"
--clear
--checklist
"
\n
Choose what you want to install:
\n
"
2
2
70 15
\
"Samba"
"Windows compatible file sharing
"
off
\
"Tasksel"
"Stock
$family
$distribution
app installer
"
off
\
"TV headend"
"TV streaming / proxy"
off
\
"TV headend"
"TV streaming / proxy"
off
\
"Syncthing"
"Personal cloud @syncthing.net"
off
\
"Syncthing"
"Personal cloud @syncthing.net"
off
\
"CUPS"
"Printing"
off
\
"CUPS"
"Printing"
off
\
"VPN server"
"VPN server"
off
\
"VPN server"
"VPN server"
off
\
"Scanner"
"Control your scanner with buttons + OCR"
off
\
"Armbianmonitor"
"Status page and statistics"
off
\
"Rpi monitor"
"Status page and statistics"
off
\
"OMV"
"OpenMediaVault NAS solution"
off
\
"Minidlna"
"Lightweight DLNA/UPnP-AV server"
off
\
"Pi hole"
"Ad blocker"
off
\
"Pi hole"
"Ad blocker"
off
\
"Transmission"
"Torrent downloading"
off
\
"Transmission"
"Torrent downloading"
off
\
"ISPConfig"
"
WWW, PHP, SQL,
SMTP, IMAP, POP3"
off 2>
$tempfile
"ISPConfig"
"
Advanced LAMP +
SMTP, IMAP, POP3"
off 2>
$tempfile
retval
=
$?
retval
=
$?
...
@@ -123,7 +121,7 @@ case $retval in
...
@@ -123,7 +121,7 @@ case $retval in
255
)
255
)
exit
;;
exit
;;
esac
esac
IFS
=
";"
IFS
=
";"
choice
=
"
${
choice
//\
" /;}"
choice
=
"
${
choice
//\
" /;}"
choice=
"
${
choice
//\
"/}"
choice=
"
${
choice
//\
"/}"
declare -a choice=(
$choice
)
declare -a choice=(
$choice
)
...
@@ -137,18 +135,18 @@ install_packet ()
...
@@ -137,18 +135,18 @@ install_packet ()
#--------------------------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------------------------------------
i=0
i=0
j=1
j=1
IFS="
"
IFS="
"
declare -a PACKETS=(
$1
)
declare -a PACKETS=(
$1
)
skupaj=
${#
PACKETS
[@]
}
skupaj=
${#
PACKETS
[@]
}
while [[
$i
-lt
$skupaj
]]; do
while [[
$i
-lt
$skupaj
]]; do
procent=
$(
echo
"scale=2;(
$j
/
$skupaj
)*100"
|bc
)
procent=
$(
echo
"scale=2;(
$j
/
$skupaj
)*100"
|bc
)
x=
${
PACKETS
[
$i
]
}
x=
${
PACKETS
[
$i
]
}
if [
$(
dpkg-query
-W
-f
=
'${Status}'
$x
2>/dev/null |
grep
-c
"ok installed"
)
-eq 0 ]; then
if [
$(
dpkg-query
-W
-f
=
'${Status}'
$x
2>/dev/null |
grep
-c
"ok installed"
)
-eq 0 ]; then
printf '%.0f
\n
'
$procent
| dialog
\
printf '%.0f
\n
'
$procent
| dialog
\
--backtitle "
$backtitle
"
\
--backtitle "
$backtitle
"
\
--title "
Installing
"
\
--title "
Installing
"
\
--gauge "
\n
$2
\n\n
$x
" 10 70
--gauge "
\n
$2
\n\n
$x
" 10 70
if [ "
$(
DEBIAN_FRONTEND
=
noninteractive apt-get
-qq
-y
install
$x
>
/tmp/install.log 2>&1
||
echo
'Installation failed'
|
grep
'Installation failed'
)
" != "" ]; then
if [ "
$(
DEBIAN_FRONTEND
=
noninteractive apt-get
-qq
-y
install
$x
>
/tmp/install.log 2>&1
||
echo
'Installation failed'
|
grep
'Installation failed'
)
" != "" ]; then
echo -e "
[\e[0;31m error \x1B[0m] Installation failed
"
echo -e "
[\e[0;31m error \x1B[0m] Installation failed
"
tail /tmp/install.log
tail /tmp/install.log
exit
exit
...
@@ -158,21 +156,27 @@ procent=$(echo "scale=2;($j/$skupaj)*100"|bc)
...
@@ -158,21 +156,27 @@ procent=$(echo "scale=2;($j/$skupaj)*100"|bc)
j=
$[$j
+1]
j=
$[$j
+1]
done
done
echo ""
echo ""
}
}
check_port (){
[[ -z
$(
netstat
-lnt
|
awk
'$6 == "LISTEN" && $4 ~ ".$1"'
)
]] && dialog --backtitle "
$backtitle
" --title "
Checking
service
" --infobox "
\nIt looks good.\n\nThere is
$2
service on port
$1
" 7 52
sleep 3
}
install_basic (){
install_basic (){
#--------------------------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------------------------------------
# Set hostname, FQDN, add to sources list
# Set hostname, FQDN, add to sources list
#--------------------------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------------------------------------
IFS="
"
IFS="
"
set
${
HOSTNAMEFQDN
//./
}
set
${
HOSTNAMEFQDN
//./
}
HOSTNAMESHORT="
$1
"
HOSTNAMESHORT="
$1
"
cp /etc/hosts /etc/hosts.backup
cp /etc/hosts /etc/hosts.backup
cp /etc/hostname /etc/hostname.backup
cp /etc/hostname /etc/hostname.backup
sed -i '/#ispconfig/d' /etc/hosts
sed -i '/#ispconfig/d' /etc/hosts
sed -e 's/127.0.0.1.*/127.0.0.1 localhost.localdomain localhost/g' -i /etc/hosts
sed -e 's/127.0.0.1.*/127.0.0.1 localhost.localdomain localhost/g' -i /etc/hosts
echo "
${
serverIP
}
${
HOSTNAMEFQDN
}
${
HOSTNAMESHORT
}
#ispconfig
" >> /etc/hosts
echo "
${
serverIP
}
${
HOSTNAMEFQDN
}
${
HOSTNAMESHORT
}
#ispconfig
" >> /etc/hosts
echo "
$HOSTNAMESHORT
" > /etc/hostname
echo "
$HOSTNAMESHORT
" > /etc/hostname
/etc/init.d/hostname.sh start >/dev/null 2>&1
/etc/init.d/hostname.sh start >/dev/null 2>&1
}
}
...
@@ -209,106 +213,33 @@ EOF
...
@@ -209,106 +213,33 @@ EOF
}
}
install_
sugarcrm
(){
install_
omv
(){
#--------------------------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------------------------------------
#
Community edition CRM
#
Install high-performance HTTP accelerator
#--------------------------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------------------------------------
cd /tmp
wget -qO - packages.openmediavault.org/public/archive.key | apt-key add -
wget http://downloads.sourceforge.net/project/sugarcrm/1%20-%20SugarCRM%206.5.X/WebPI/SugarCE-6.5.18-WebPI.zip
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7AA630A1EDEE7D73
unzip SugarCE-6.5.18-WebPI.zip
cd SugarCE-Full-6.5.18
mv * /usr/share/nginx/www
}
cat > /etc/apt/sources.list.d/openmediavault.list << EOF
deb http://packages.openmediavault.org/public erasmus main
install_varnish (){
## Uncomment the following line to add software from the proposed repository.
#--------------------------------------------------------------------------------------------------------------------------------
# deb http://packages.openmediavault.org/public erasmus-proposed main
# Install high-performance HTTP accelerator
#--------------------------------------------------------------------------------------------------------------------------------
wget -O - https://repo.varnish-cache.org/GPG-key.txt | apt-key add -
cat > /etc/apt/sources.list.d/varnish-cache.list<<EOF
deb-src https://repo.varnish-cache.org/debian/ jessie varnish-4.1
EOF
apt-get update
apt-get build-dep varnish -y
cd /tmp
apt-get source varnish -y
rm varnish_*.dsc
rm varnish_*.orig.tar.gz
rm varnish_*.diff.gz
cd varnish-4*
./configure --prefix=/usr
make -j
$(
ncpu
)
make install
cp debian/varnish.init /etc/init.d/varnish
chmod +x /etc/init.d/varnish
cp debian/varnish.default /etc/default/varnish
update-rc.d varnish defaults
mkdir -p /etc/varnish
cp etc/example.vcl /etc/varnish/default.vcl
dd if=/dev/random of=/etc/varnish/secret count=1
service varnish start
}
install_rpimonitor (){
## This software is not part of OpenMediaVault, but is offered by third-party
#--------------------------------------------------------------------------------------------------------------------------------
## developers as a service to OpenMediaVault users.
# Install rpimonitor with custom config
#--------------------------------------------------------------------------------------------------------------------------------
if !(grep -qs XavierBerger "
/etc/apt/sources.list
");then
cat >> /etc/apt/sources.list <<EOF
# RPi-Monitor official repository
deb https://github.com XavierBerger/RPi-Monitor-deb/raw/master/repo/
EOF
fi
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2C0D3C0F
debconf-apt-progress -- apt-get update
debconf-apt-progress -- apt-get -y install rpimonitor
service rpimonitor stop
# add my own configuration which is not default
cd /etc/rpimonitor
wget https://github.com/igorpecovnik/Debian-micro-home-server/blob/next/src/rpimonitor-myconfig.tgz?raw=true -O - | tar -xhz
cd /usr/local/bin
wget https://github.com/igorpecovnik/Debian-micro-home-server/blob/next/src/temp-pir-daemon.sh?raw=true -O temp-pir-daemon.sh
chmod +x /usr/local/bin/temp-pir-daemon.sh
sed -e 's/exit 0//g' -i /etc/rc.local
cat >> /etc/rc.local <<"
EOF
"
nohup /usr/local/bin/temp-pir-daemon.sh &
exit 0
EOF
rm -rf /var/lib/rpimonitor/stat
mkdir -p /var/log/rpimonitor
nohup /usr/local/bin/temp-pir-daemon.sh &
service rpimonitor start
/usr/share/rpimonitor/scripts/updatePackagesStatus.pl
}
# deb http://packages.openmediavault.org/public erasmus partner
install_bmc180 (){
EOF
#--------------------------------------------------------------------------------------------------------------------------------
debconf-apt-progress -- apt-get update
# Install temp and pressure sensor read utility
install_packet "
openmediavault
postfix openmediavault-flashmemory
" "
Install
network attached storage (NAS) solution
"
#--------------------------------------------------------------------------------------------------------------------------------
URL='http://omv-extras.org/openmediavault-omvextrasorg_latest_all3.deb'; FILE=
`
mktemp
`
; wget "
$URL
" -qO
$FILE
&& sudo dpkg -i
$FILE
; rm
$FILE
cd /tmp
/usr/sbin/omv-update
git clone https://github.com/maasdoel/bmp180
sed -i '/<flashmemory>/,/<
\/
flashmemory>/ s/<enable>0/<enable>1/' /etc/openmediavault/config.xml
cd bmp180
/usr/sbin/omv-mkconf flashmemory
# let's change bus number to suits our need
check_port 80
sed -i "
s
/dev\/i2c-1/dev\/i2c-2/
" bmp180dev3.c
gcc -Wall -o bmp180 ./bmp180dev3.c -lm
cp bmp180 /usr/local/bin
rm -r /tmp/bmp180
}
install_tsl2561 (){
#--------------------------------------------------------------------------------------------------------------------------------
# Install light sensor read utility
#--------------------------------------------------------------------------------------------------------------------------------
cd /tmp
wget https://github.com/igorpecovnik/Debian-micro-home-server/blob/next/src/tsl2561-src.tgz?raw=true -O - | tar -xz
gcc -Wall -O2 -o TSL2561.o -c TSL2561.c
gcc -Wall -O2 -o TSL2561_test.o -c TSL2561_test.c
gcc -Wall -O2 -o TSL2561_test TSL2561.o TSL2561_test.o
cp TSL2561_test /usr/local/bin/tsl2561
}
}
...
@@ -316,14 +247,16 @@ install_tvheadend (){
...
@@ -316,14 +247,16 @@ install_tvheadend (){
#--------------------------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------------------------------------
# TVheadend https://tvheadend.org/
# TVheadend https://tvheadend.org/
#--------------------------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------------------------------------
install_packet "
debconf
-utils unzip build-essential html2text apt-transport-https
" "
Downloading
dependendies
"
if !(grep -qs tvheadend "
/etc/apt/sources.list.d/tvheadend.list
");then
if !(grep -qs tvheadend "
/etc/apt/sources.list.d/tvheadend.list
");then
echo "
deb
https
://dl.bintray.com/tvheadend/deb
$distribution
releas
e
" >> /etc/apt/sources.list.d/tvheadend.list
echo "
deb
https
://dl.bintray.com/tvheadend/deb
$distribution
stabl
e
" >> /etc/apt/sources.list.d/tvheadend.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61 >/dev/null 2>&1
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61 >/dev/null 2>&1
fi
fi
debconf-apt-progress -- apt-get update
install_packet "
libssl
-doc libssl1.0.0 zlib1g-dev tvheadend xmltv-util
"
install_packet "
libssl
-doc libssl1.0.0 zlib1g-dev tvheadend xmltv-util
"
install -m 755 scripts/tv_grab_file /usr/bin/tv_grab_file
install -m 755 scripts/tv_grab_file /usr/bin/tv_grab_file
sed -i 's/name"
:
".*"
/name
": "
'$tv_user'
"/' /home/hts/.hts/tvheadend/superuser
dpkg-reconfigure tvheadend
sed -i 's/word"
:
".*"
/word
": "
'$tv_pass'
"/' /home/hts/.hts/tvheadend/superuser
service tvheadend restart
service tvheadend restart
}
}
...
@@ -332,43 +265,16 @@ install_transmission (){
...
@@ -332,43 +265,16 @@ install_transmission (){
#--------------------------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------------------------------------
# transmission
# transmission
#--------------------------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------------------------------------
install_packet "
debconf
-utils unzip build-essential html2text apt-transport-https
" "
Downloading
dependendies
"
install_packet "
transmission
-cli transmission-common transmission-daemon
" "
Install
torrent server
"
install_packet "
transmission
-cli transmission-common transmission-daemon
" "
Install
torrent server
"
}
}
install_samba (){
#---------------------------------------------------------------------------------------------------------------------------------
# install Samba file sharing
#---------------------------------------------------------------------------------------------------------------------------------
# Read samba user / pass / group
local SECTION="
Samba
"
SMBUSER=
$(
whiptail
--inputbox
"What is your samba username?"
8 78
$SMBUSER
--title
"
$SECTION
"
3>&1 1>&2 2>&3
)
exitstatus=
$?
; if [
$exitstatus
= 1 ]; then exit 1; fi
SMBPASS=
$(
whiptail
--inputbox
"What is your samba password?"
8 78
$SMBPASS
--title
"
$SECTION
"
3>&1 1>&2 2>&3
)
exitstatus=
$?
; if [
$exitstatus
= 1 ]; then exit 1; fi
SMBGROUP=
$(
whiptail
--inputbox
"What is your samba group?"
8 78
$SMBGROUP
--title
"
$SECTION
"
3>&1 1>&2 2>&3
)
exitstatus=
$?
; if [
$exitstatus
= 1 ]; then exit 1; fi
#
debconf-apt-progress -- apt-get -y install samba samba-common-bin
useradd
$SMBUSER
echo -ne "
$SMBPASS
\n
$SMBPASS
\n
" | passwd
$SMBUSER
>/dev/null 2>&1
echo -ne "
$SMBPASS
\n
$SMBPASS
\n
" | smbpasswd -a -s
$SMBUSER
>/dev/null 2>&1
service samba stop | service smbd stop >/dev/null 2>&1
cp scripts/smb.conf /etc/samba/smb.conf
sed -i "
s
/SMBGROUP/
$SMBGROUP
/
" /etc/samba/smb.conf
sed -i "
s
/SMBUSER/
$SMBUSER
/
" /etc/samba/smb.conf
sed -i "
s
/SUBNET/
$SUBNET
/
" /etc/samba/smb.conf
mkdir -p /ext
chmod -R 777 /ext
service samba start | service smbd start >/dev/null 2>&1
}
install_cups (){
install_cups (){
#--------------------------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------------------------------------
# Install printer system
# Install printer system
#--------------------------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------------------------------------
debconf-apt-progress -- apt-get -y install cups lpr foomatic-filters
install_packet "
cups
lpr cups-filters
" "
Installing
CUPS
"
# cups-filters if jessie
# cups-filters if jessie
sed -e 's/Listen localhost:631/Listen 631/g' -i /etc/cups/cupsd.conf
sed -e 's/Listen localhost:631/Listen 631/g' -i /etc/cups/cupsd.conf
sed -e 's/<Location
\/
>/<Location
\/
>
\n
allow
$SUBNET
/g' -i /etc/cups/cupsd.conf
sed -e 's/<Location
\/
>/<Location
\/
>
\n
allow
$SUBNET
/g' -i /etc/cups/cupsd.conf
...
@@ -376,54 +282,26 @@ sed -e 's/<Location \/admin>/<Location \/admin>\nallow $SUBNET/g' -i /etc/cups/c
...
@@ -376,54 +282,26 @@ sed -e 's/<Location \/admin>/<Location \/admin>\nallow $SUBNET/g' -i /etc/cups/c
sed -e 's/<Location
\/
admin
\/
conf>/<Location
\/
admin
\/
conf>
\n
allow
$SUBNET
/g' -i /etc/cups/cupsd.conf
sed -e 's/<Location
\/
admin
\/
conf>/<Location
\/
admin
\/
conf>
\n
allow
$SUBNET
/g' -i /etc/cups/cupsd.conf
service cups restart
service cups restart
service samba restart | service smbd restart >/dev/null 2>&1
service samba restart | service smbd restart >/dev/null 2>&1
}
}
install_scaner_and_scanbuttons (){
#--------------------------------------------------------------------------------------------------------------------------------
# Install Scanner buttons
#--------------------------------------------------------------------------------------------------------------------------------
install_packet "
pdftk
libusb-dev sane sane-utils libudev-dev imagemagick libtiff-tools
" "
Install
Scanner buttons
"
# wget http://wp.psyx.us/wp-content/uploads/2010/10/scanbuttond-0.2.3.genesys.tar.gz
wget https://github.com/igorpecovnik/Debian-micro-home-server/raw/master/src/scanbuttond-0.2.3.genesys.tar.gz
tar xvfz scanbuttond-0.2.3.genesys.tar.gz
rm scanbuttond-0.2.3.genesys.tar.gz
cd scanbuttond-0.2.3.genesys
chmod +x configure
make clean
./configure --prefix=/usr --sysconfdir=/etc
make
make install
echo "
sane
-find-scanner
" >> /etc/scanbuttond/initscanner.sh
sed -e 's/does nothing./does nothing.
\n\/
usr
\/
bin
\/
scanbuttond/g' -i /etc/rc.local
}
install_ocr (){
#--------------------------------------------------------------------------------------------------------------------------------
# Install OCR
# get script from here https://github.com/gkovacs/pdfocr
#--------------------------------------------------------------------------------------------------------------------------------
wget https://raw2.github.com/gkovacs/pdfocr/master/pdfocr.rb
mv pdfocr.rb /usr/local/bin/pdfocr
chmod +x /usr/local/bin/pdfocr
apt-get -y install ruby tesseract-ocr libtiff-tools
}
install_syncthing (){
install_syncthing (){
#--------------------------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------------------------------------
# Install Personal cloud https://syncthing.net/
# Install Personal cloud https://syncthing.net/
#--------------------------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------------------------------------
curl -s https://syncthing.net/release-key.txt | apt-key add -
curl -s https://syncthing.net/release-key.txt | apt-key add -
echo "
deb
http
://apt.syncthing.net/
syncthing release
" | tee /etc/apt/sources.list.d/syncthing-release.list
if !(grep -qs syncthing "
/etc/apt/sources.list.d/syncthing.list
");then
apt-get update | dialog --backtitle
$backtitle
--progressbox "
Force
package list update ...
"
$TTY_X
$TTY_Y
echo "
deb
http
://apt.syncthing.net/
syncthing release
" | tee /etc/apt/sources.list.d/syncthing.list
install_packet "
syncthing
" "
Install
Personal cloud https
://syncthing.net/
"
debconf-apt-progress -- apt-get update
sed -e 's/exit 0//g' -i /etc/rc.local
install_packet "
syncthing
" "
Install
Personal cloud https
://syncthing.net/
"
cat >> /etc/rc.local <<"
EOF
"
sed -e 's/exit 0//g' -i /etc/rc.local
cat >> /etc/rc.local <<"
EOF
"
syncthing
syncthing
exit 0
exit 0
EOF
EOF
syncthing >/dev/null 2>&1 &
sleep 5
fi
}
}
...
@@ -467,7 +345,7 @@ EOT
...
@@ -467,7 +345,7 @@ EOT
systemctl enable ethervpn.service
systemctl enable ethervpn.service
service ethervpn start
service ethervpn start
else
else
cat <<EOT > /etc/init.d/vpnserver
cat <<EOT > /etc/init.d/vpnserver
#!/bin/sh
#!/bin/sh
...
@@ -518,7 +396,7 @@ install_DashNTP (){
...
@@ -518,7 +396,7 @@ install_DashNTP (){
echo
"dash dash/sh boolean false"
| debconf-set-selections
echo
"dash dash/sh boolean false"
| debconf-set-selections
dpkg-reconfigure
-f
noninteractive dash
>
/dev/null 2>&1
dpkg-reconfigure
-f
noninteractive dash
>
/dev/null 2>&1
install_packet
"ntp ntpdate"
"Install DASH and ntp service"
install_packet
"ntp ntpdate"
"Install DASH and ntp service"
}
}
install_MySQL
(){
install_MySQL
(){
...
@@ -763,6 +641,6 @@ install_ISPConfig (){
...
@@ -763,6 +641,6 @@ install_ISPConfig (){
cd
/tmp
cd
/tmp
wget
-q
http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
-O
- |
tar
-xz
wget
-q
http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
-O
- |
tar
-xz
cd
/tmp/ispconfig3_install/install/
cd
/tmp/ispconfig3_install/install/
#apt-get -y install php5-cli php5-mysql
#apt-get -y install php5-cli php5-mysql
php
-q
install.php
--autoinstall
=
/tmp/isp.conf.php
php
-q
install.php
--autoinstall
=
/tmp/isp.conf.php
}
}
install.sh
View file @
51c7db5a
...
@@ -24,7 +24,7 @@ fi
...
@@ -24,7 +24,7 @@ fi
# Debian only
# Debian only
if
[
!
-f
/etc/debian_version
]
;
then
if
[
!
-f
/etc/debian_version
]
;
then
dialog
--msgbox
"Warning: Unsupported Linux Distribution, it might not install properly. Tailored for Debian. "
7 70
dialog
--msgbox
"Warning: Unsupported Linux Distribution, it might not install properly. Tailored for Debian. "
7 70
fi
fi
...
@@ -37,46 +37,54 @@ fi
...
@@ -37,46 +37,54 @@ fi
# Choose what to install
# Choose what to install
what_to_install
what_to_install
before_install
for
menu_choice
in
"
${
choice
[@]
}
"
for
i
in
"
${
choice
[@]
}
"
do
do
if
[[
"
$menu_choice
"
==
ISPConfig
*
]]
;
then
if
[[
"
$i
"
==
ISPConfig
*
]]
;
then
server_conf
server_conf
if
[[
"
$MYSQL_PASS
"
==
""
]]
;
then
if
[[
"
$MYSQL_PASS
"
==
""
]]
;
then
dialog
--msgbox
"Mysql password can't be blank. Exiting..."
7 70
dialog
--msgbox
"Mysql password can't be blank. Exiting..."
7 70
exit
exit
fi
fi
install_basic
;
install_DashNTP
;
install_MySQL
;
install_MySQLDovecot
;
install_Virus
;
install_
$server
install_basic
;
install_DashNTP
;
install_MySQL
;
install_MySQLDovecot
;
install_Virus
;
install_
$server
create_ispconfig_configuration
;
install_PureFTPD
;
install_Fail2BanDovecot
;
install_Fail2BanRulesDovecot
;
create_ispconfig_configuration
;
install_PureFTPD
;
install_Fail2BanDovecot
;
install_Fail2BanRulesDovecot
;
install_ISPConfig
install_ISPConfig
fi
fi
if
[[
"
$
i
"
==
Samba
*
]]
;
then
if
[[
"
$
menu_choice
"
==
*
Tasksel
*
]]
;
then
install_samba
tasksel
fi
fi
if
[[
"
$
i
"
==
*
headend
*
]]
;
then
if
[[
"
$
menu_choice
"
==
*
headend
*
]]
;
then
install_tvheadend
install_tvheadend
check_port 9981
echo
$menu_choice
;
fi
fi
if
[[
"
$
i
"
==
Syncthing
*
]]
;
then
if
[[
"
$
menu_choice
"
==
*
Syncthing
*
]]
;
then
install_syncthing
install_syncthing
check_port 8384
"Syncthing"
fi
fi
if
[[
"
$
i
"
==
CUPS
*
]]
;
then
if
[[
"
$
menu_choice
"
==
CUPS
*
]]
;
then
install_cups
install_cups
fi
fi
if
[[
"
$
i
"
==
*
server
*
]]
;
then
if
[[
"
$
menu_choice
"
==
*
server
*
]]
;
then
install_vpn_server
install_vpn_server
fi
fi
if
[[
"
$
i
"
==
Scanner
*
]]
;
then
if
[[
"
$
menu_choice
"
==
Scanner
*
]]
;
then
install_scaner_and_scanbuttons
install_scaner_and_scanbuttons
fi
fi
if
[[
"
$i
"
==
*
monitor
*
]]
;
then
if
[[
"
$menu_choice
"
==
*
monitor
*
]]
;
then
install_rpimonitor
armbianmonitor
-r
fi
if
[[
"
$menu_choice
"
==
*
OMV
*
]]
;
then
install_omv
fi
fi
if
[[
"
$
i
"
==
*
hole
*
]]
;
then
if
[[
"
$
menu_choice
"
==
*
hole
*
]]
;
then
curl
-L
install.pi-hole.net | bash
curl
-L
install.pi-hole.net | bash
fi
fi
if
[[
"
$i
"
==
Transmission
*
]]
;
then
if
[[
"
$menu_choice
"
==
*
Minidlna
*
]]
;
then
install_packet
"minidlna"
"Install lightweight DLNA/UPnP-AV server"
check_port 8200
fi
if
[[
"
$menu_choice
"
==
*
Transmission
*
]]
;
then
install_transmission
install_transmission
check_port 9091
fi
fi
done
done
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment