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
Show whitespace changes
Inline
Side-by-side
README.md
View file @
73d8e30e
...
@@ -60,9 +60,8 @@ Login as root and type:
...
@@ -60,9 +60,8 @@ Login as root and type:
**Running this utility on 3rd party Debian based distributions**
**Running this utility on 3rd party Debian based distributions**
# Install dependencies
# Install dependencies
apt install git iperf3 qrencode psmisc curl bc expect dialog network-manager sunxi-tools iptables \
apt install git iperf3 psmisc curl bc expect dialog network-manager sunxi-tools iptables \
resolvconf debconf-utils unzip build-essential html2text apt-transport-https html2text dirmngr \
debconf-utils unzip dirmngr software-properties-common
software-properties-common libpam-google-authenticator qrencode ppp
git clone https://github.com/armbian/config
git clone https://github.com/armbian/config
cd config
cd config
...
...
debian-config-functions
View file @
73d8e30e
...
@@ -181,7 +181,7 @@ function is_package_manager_running() {
...
@@ -181,7 +181,7 @@ function is_package_manager_running() {
if
[[
$?
=
0
]]
;
then
if
[[
$?
=
0
]]
;
then
# 0 = true
# 0 = true
dialog
--colors
--title
"
\Z
1Error
\Z
0 "
--backtitle
"
$BACKTITLE
"
--no-collapse
--msgbox
\
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
return
0
else
else
# 1 = false
# 1 = false
...
...
debian-config-jobs
View file @
73d8e30e
...
@@ -326,6 +326,7 @@ function jobs ()
...
@@ -326,6 +326,7 @@ function jobs ()
# Connect to 3G/4G network
# Connect to 3G/4G network
#
#
"LTE"
)
"LTE"
)
if
!
is_package_manager_running
;
then
if
[[
$LTE_MODEM
==
*
online
*
]]
;
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
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"
[[
$?
=
1
]]
&&
lte
"
$LTE_MODEM_ID
"
"off"
...
@@ -333,6 +334,7 @@ function jobs ()
...
@@ -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
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"
[[
$?
=
1
]]
&&
lte
"
$LTE_MODEM_ID
"
"on"
fi
fi
fi
;;
;;
...
@@ -1131,8 +1133,14 @@ function jobs ()
...
@@ -1131,8 +1133,14 @@ function jobs ()
# Toggle sshd options
# Toggle sshd options
#
#
"SSH"
)
"SSH"
)
if
!
is_package_manager_running
;
then
while
true
;
do
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_CANCEL
=
2
DIALOG_ESC
=
255
DIALOG_ESC
=
255
LIST_CONST
=
7
LIST_CONST
=
7
...
@@ -1193,12 +1201,6 @@ function jobs ()
...
@@ -1193,12 +1201,6 @@ function jobs ()
# phone
# phone
if
[[
"
${
my_array
[*]
}
"
==
*
" PhoneAuthentication "
*
]]
;
then
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"
MergeParameter
=
"keyboard-interactive"
sed
-i
"s/^#
\?
ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/"
/etc/ssh/sshd_config
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
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 ()
...
@@ -1258,6 +1260,7 @@ function jobs ()
;;
;;
esac
esac
done
done
fi
;;
;;
...
...
debian-software
View file @
73d8e30e
...
@@ -185,8 +185,13 @@ function check_status
...
@@ -185,8 +185,13 @@ function check_status
LIST
+=
(
"Docker"
"Run applications by using containers"
"
$DOCKER_STATUS
"
)
LIST
+=
(
"Docker"
"Run applications by using containers"
"
$DOCKER_STATUS
"
)
# Mayan EDMS docker install
# Mayan EDMS docker install
if
[[
"
$DOCKER_STATUS
"
==
"on"
]];
then
curl
--
output
/
dev
/
null
--
silent
--
head
--
fail
http
://
localhost
/
authentication
/
login
/?
next
=
curl
--
output
/
dev
/
null
--
silent
--
head
--
fail
http
://
localhost
/
authentication
/
login
/?
next
=
MAYAN_STATUS
=
$
([[
$
?
-
eq
0
]]
&&
echo
"on"
||
echo
"off"
)
MAYAN_STATUS
=
$
([[
$
?
-
eq
0
]]
&&
echo
"on"
||
echo
"off"
)
else
MAYAN_STATUS
=
"off"
fi
LIST
+=
(
"Mayan EDMS"
"Electronic vault for your documents"
"
$MAYAN_STATUS
"
)
LIST
+=
(
"Mayan EDMS"
"Electronic vault for your documents"
"
$MAYAN_STATUS
"
)
# ISPconfig
# ISPconfig
...
@@ -1536,7 +1541,7 @@ while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
...
@@ -1536,7 +1541,7 @@ while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
((i=i+1))
((i=i+1))
done
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
# gather some info
#
#
...
@@ -1579,7 +1584,7 @@ while true; do
...
@@ -1579,7 +1584,7 @@ while true; do
# cycle trought all install options
# cycle trought all install options
i=0
i=0
if ! is_package_manager_running; then
while [ "$i" -lt "$LISTLENGHT" ]; do
while [ "$i" -lt "$LISTLENGHT" ]; do
if [[ "$selection" == *Samba*
&&
"$SAMBA_STATUS" != "on" ]]; then
if [[ "$selection" == *Samba*
&&
"$SAMBA_STATUS" != "on" ]]; then
...
@@ -1702,6 +1707,9 @@ while true; do
...
@@ -1702,6 +1707,9 @@ while true; do
i=$[$i+1]
i=$[$i+1]
done
done
fi
# reread statuses
# reread statuses
check_status
check_status
done
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