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
73d8e30e
Commit
73d8e30e
authored
Oct 21, 2018
by
root
Browse files
Small fixes, hardening, cleanup
parent
027233a4
Changes
4
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
73d8e30e
...
...
@@ -60,9 +60,8 @@ Login as root and type:
**Running this utility on 3rd party Debian based distributions**
# Install dependencies
apt install git iperf3 qrencode psmisc curl bc expect dialog network-manager sunxi-tools iptables \
resolvconf debconf-utils unzip build-essential html2text apt-transport-https html2text dirmngr \
software-properties-common libpam-google-authenticator qrencode ppp
apt install git iperf3 psmisc curl bc expect dialog network-manager sunxi-tools iptables \
debconf-utils unzip dirmngr software-properties-common
git clone https://github.com/armbian/config
cd config
...
...
debian-config-functions
View file @
73d8e30e
...
...
@@ -181,7 +181,7 @@ function is_package_manager_running() {
if
[[
$?
=
0
]]
;
then
# 0 = true
dialog
--colors
--title
"
\Z
1Error
\Z
0 "
--backtitle
"
$BACKTITLE
"
--no-collapse
--msgbox
\
"
\n\Z
1
Package manager is running in the background.
\n\n
Can't
proceed
. Try again later."
9 53
"
\n\Z
0
Package manager is running in the background.
\n\n
Can't
install dependencies
. Try again later."
9 53
return
0
else
# 1 = false
...
...
@@ -561,10 +561,10 @@ function configure_desktop ()
# install desktop package
debconf-apt-progress
--
apt-get
-y
install
$1
armbian-
${
DISTROID
}
-desktop
# in case previous install was interrupted
[[
$?
-eq
130
]]
&&
dpkg
--configure
-a
# strectch workaround
[[
${
DISTROID
}
==
stretch
]]
&&
debconf-apt-progress
--
apt
-y
purge lightdm
# install display manager
...
...
debian-config-jobs
View file @
73d8e30e
...
...
@@ -164,9 +164,9 @@ function jobs ()
#
# Install kernel source
#
"Source"
)
# Install kernel source
#
"Source"
)
if
!
is_package_manager_running
;
then
if
[[
-n
$(
dpkg
-l
|
grep
$SOURCE_PKG
)
]]
;
then
debconf-apt-progress
--
apt-get
-y
purge
${
SOURCE_PKG
}
...
...
@@ -326,6 +326,7 @@ function jobs ()
# Connect to 3G/4G network
#
"LTE"
)
if
!
is_package_manager_running
;
then
if
[[
$LTE_MODEM
==
*
online
*
]]
;
then
dialog
--title
" LTE modem is connected "
--colors
--backtitle
"
$BACKTITLE
"
--yes-label
"Back"
--no-label
"Disconnect"
--yesno
"
\n\Z
1Disconnect:
\Z
0 kill mobile connection
\n\n
"
7 42
[[
$?
=
1
]]
&&
lte
"
$LTE_MODEM_ID
"
"off"
...
...
@@ -333,6 +334,7 @@ function jobs ()
dialog
--title
" LTE modem is disconnected "
--colors
--backtitle
"
$BACKTITLE
"
--yes-label
"Back"
--no-label
"Connect"
--yesno
"
\n\Z
1Connect:
\Z
0 dial mobile connection
\n\n
"
7 42
[[
$?
=
1
]]
&&
lte
"
$LTE_MODEM_ID
"
"on"
fi
fi
;;
...
...
@@ -1131,8 +1133,14 @@ function jobs ()
# Toggle sshd options
#
"SSH"
)
if
!
is_package_manager_running
;
then
while
true
;
do
if
!
check_if_installed libpam-google-authenticator
;
then
debconf-apt-progress
--
apt-get
-y
install
libpam-google-authenticator
fi
if
!
check_if_installed qrencode
;
then
debconf-apt-progress
--
apt-get
-y
install
qrencode
fi
DIALOG_CANCEL
=
2
DIALOG_ESC
=
255
LIST_CONST
=
7
...
...
@@ -1193,12 +1201,6 @@ function jobs ()
# phone
if
[[
"
${
my_array
[*]
}
"
==
*
" PhoneAuthentication "
*
]]
;
then
if
!
check_if_installed libpam-google-authenticator
;
then
debconf-apt-progress
--
apt-get
-y
install
libpam-google-authenticator
fi
if
!
check_if_installed qrencode
;
then
debconf-apt-progress
--
apt-get
-y
install
qrencode
fi
MergeParameter
=
"keyboard-interactive"
sed
-i
"s/^#
\?
ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/"
/etc/ssh/sshd_config
sed
-i
-n
'/password updating/{p;:a;N;/@include common-password/!ba;s/.*\n/auth required pam_google_authenticator.so nullok\n/};p'
/etc/pam.d/sshd
...
...
@@ -1258,6 +1260,7 @@ function jobs ()
;;
esac
done
fi
;;
...
...
debian-software
View file @
73d8e30e
...
...
@@ -185,8 +185,13 @@ function check_status
LIST
+=
(
"Docker"
"Run applications by using containers"
"
$DOCKER_STATUS
"
)
# Mayan EDMS docker install
curl
--
output
/
dev
/
null
--
silent
--
head
--
fail
http
://
localhost
/
authentication
/
login
/?
next
=
MAYAN_STATUS
=
$
([[
$
?
-
eq
0
]]
&&
echo
"on"
||
echo
"off"
)
if
[[
"
$DOCKER_STATUS
"
==
"on"
]];
then
curl
--
output
/
dev
/
null
--
silent
--
head
--
fail
http
://
localhost
/
authentication
/
login
/?
next
=
MAYAN_STATUS
=
$
([[
$
?
-
eq
0
]]
&&
echo
"on"
||
echo
"off"
)
else
MAYAN_STATUS
=
"off"
fi
LIST
+=
(
"Mayan EDMS"
"Electronic vault for your documents"
"
$MAYAN_STATUS
"
)
# ISPconfig
...
...
@@ -692,7 +697,7 @@ else
fi
URL="http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u9_"$(dpkg --print-architecture)".deb"
fancy_wget "$URL" "-O ${TEMP_DIR}/package.deb"
dpkg -i ${TEMP_DIR}/package.deb >/dev/null 2>
&
1
dpkg -i ${TEMP_DIR}/package.deb >/dev/null 2>
&
1
debconf-apt-progress -- apt-get update
debconf-apt-progress -- apt-get -y install libssl-doc zlib1g-dev tvheadend xmltv-util
fi
...
...
@@ -1536,7 +1541,7 @@ while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
((i=i+1))
done
apt-get -qq -y --no-install-recommends install debconf-utils html2text apt-transport-https dialog whiptail lsb-release bc expect > /dev/null
apt-get -qq -y --no-install-recommends install
curl
debconf-utils html2text apt-transport-https dialog whiptail lsb-release bc expect > /dev/null
# gather some info
#
...
...
@@ -1579,7 +1584,7 @@ while true; do
# cycle trought all install options
i=0
if ! is_package_manager_running; then
while [ "$i" -lt "$LISTLENGHT" ]; do
if [[ "$selection" == *Samba*
&&
"$SAMBA_STATUS" != "on" ]]; then
...
...
@@ -1702,6 +1707,9 @@ while true; do
i=$[$i+1]
done
fi
# reread statuses
check_status
done
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