Linux mail.vriendennsm.nl 6.1.0-51-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.177-1 (2026-07-16) x86_64
Apache/2.4.68 (Debian)
Server IP : 217.154.75.17 & Your IP : 216.73.216.195
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
webmin /
Delete
Unzip
Name
Size
Permission
Date
Action
acl
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
adsl-client
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
apache
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
at
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
authentic-theme
[ DIR ]
drwxr-xr-x
2026-07-25 20:56
backup-config
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
bacula-backup
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
bandwidth
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
bin
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
bind8
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
blue-theme
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
change-user
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
cluster-copy
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
cluster-cron
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
cluster-passwd
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
cluster-shell
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
cluster-software
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
cluster-useradmin
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
cluster-usermin
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
cluster-webmin
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
cpan
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
cron
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
custom
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
dfsadmin
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
dhcpd
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
dovecot
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
exim
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
exports
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
fail2ban
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
fdisk
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
fetchmail
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
filemin
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
filter
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
firewall
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
firewall6
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
firewalld
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
fsdump
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
gray-theme
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
grub2
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
heartbeat
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
htaccess-htpasswd
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
idmapd
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
images
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
inetd
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
init
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
inittab
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
ipfilter
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
ipfw
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
ipsec
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
iscsi-client
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
iscsi-server
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
iscsi-target
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
iscsi-tgtd
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
kea-dhcp
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
krb5
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
lang
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
ldap-client
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
ldap-server
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
ldap-useradmin
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
logrotate
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
logviewer
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
lpadmin
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
lvm
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
mailboxes
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
mailcap
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
man
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
mount
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
mysql
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
net
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
nftables
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
nginx
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
nis
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
openslp
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
package-updates
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
pam
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
pap
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
passwd
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
phpini
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
postfix
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
postgresql
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
ppp-client
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
pptp-client
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
pptp-server
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
proc
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
procmail
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
proftpd
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
qmailadmin
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
quota
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
raid
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
samba
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
sarg
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
sendmail
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
servers
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
shell
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
shorewall
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
shorewall6
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
smart-status
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
smf
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
software
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
spam
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
squid
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
sshd
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
status
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
stunnel
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
syslog
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
syslog-ng
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
system-status
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
systemd
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
tcpwrappers
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
time
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
tunnel
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
unauthenticated
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
updown
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
useradmin
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
usermin
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
vendor_perl
[ DIR ]
drwxr-xr-x
2026-06-10 18:25
webalizer
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
webmin
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
webmincron
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
webminlog
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
xinetd
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
xterm
[ DIR ]
drwxr-xr-x
2026-07-25 20:55
LICENCE
1.48
KB
-rw-r--r--
2026-07-17 21:17
LICENCE.ja
1.62
KB
-rw-r--r--
2026-07-17 21:17
README.md
4.23
KB
-rw-r--r--
2026-07-17 21:17
WebminCore.pm
9.05
KB
-rw-r--r--
2026-07-17 21:17
acl_security.pl
4.87
KB
-rwxr-xr-x
2026-07-17 21:17
changepass.pl
868
B
-rwxr-xr-x
2026-07-17 21:22
chooser.cgi
7.21
KB
-rwxr-xr-x
2026-07-17 21:22
config-aix
227
B
-rw-r--r--
2026-07-17 21:17
config-cobalt-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-coherent-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-corel-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-debian-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-freebsd
256
B
-rw-r--r--
2026-07-17 21:17
config-generic-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-gentoo-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-hpux
243
B
-rw-r--r--
2026-07-17 21:17
config-irix
284
B
-rw-r--r--
2026-07-17 21:17
config-lib.pl
11.84
KB
-rwxr-xr-x
2026-07-17 21:17
config-macos
260
B
-rw-r--r--
2026-07-17 21:17
config-mandrake-linux
278
B
-rw-r--r--
2026-07-17 21:17
config-msc-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-netbsd
283
B
-rw-r--r--
2026-07-17 21:17
config-open-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-openbsd
241
B
-rw-r--r--
2026-07-17 21:17
config-openmamba-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-openserver
236
B
-rw-r--r--
2026-07-17 21:17
config-osf1
266
B
-rw-r--r--
2026-07-17 21:17
config-pardus-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-redhat-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-slackware-linux
280
B
-rw-r--r--
2026-07-17 21:17
config-sol-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-solaris
417
B
-rw-r--r--
2026-07-17 21:17
config-suse-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-syno-linux
364
B
-rw-r--r--
2026-07-17 21:17
config-trustix-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-turbo-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-united-linux
264
B
-rw-r--r--
2026-07-17 21:17
config-unixware
286
B
-rw-r--r--
2026-07-17 21:17
config-windows
88
B
-rw-r--r--
2026-07-17 21:17
config.cgi
1.64
KB
-rwxr-xr-x
2026-07-17 21:22
config_save.cgi
1.68
KB
-rwxr-xr-x
2026-07-17 21:22
copyconfig.pl
4.33
KB
-rwxr-xr-x
2026-07-17 21:22
create-module.pl
3.95
KB
-rwxr-xr-x
2026-07-17 21:22
date_chooser.cgi
2.19
KB
-rwxr-xr-x
2026-07-17 21:22
deb-name
7
B
-rw-r--r--
2026-07-17 21:22
defaultacl
124
B
-rw-r--r--
2026-07-17 21:17
defaulttheme
16
B
-rw-r--r--
2026-07-17 21:17
entities_map.txt
1.47
KB
-rw-r--r--
2026-07-17 21:17
fastrpc.cgi
11.87
KB
-rwxr-xr-x
2026-07-17 21:22
favicon.ico
14.73
KB
-rw-r--r--
2026-07-17 21:17
forgot.cgi
6.27
KB
-rwxr-xr-x
2026-07-17 21:22
forgot_form.cgi
1.14
KB
-rwxr-xr-x
2026-07-17 21:22
forgot_send.cgi
5.11
KB
-rwxr-xr-x
2026-07-17 21:22
group_chooser.cgi
7.51
KB
-rwxr-xr-x
2026-07-17 21:22
help.cgi
2.26
KB
-rwxr-xr-x
2026-07-17 21:22
html-editor-lib.pl
17.72
KB
-rw-r--r--
2026-07-17 21:17
index.cgi
5.61
KB
-rwxr-xr-x
2026-07-17 21:22
install-module.pl
1.54
KB
-rwxr-xr-x
2026-07-17 21:22
install-type
4
B
-rw-r--r--
2026-07-17 21:22
javascript-lib.pl
14.69
KB
-rwxr-xr-x
2026-07-17 21:17
lang_list.txt
2.51
KB
-rw-r--r--
2026-07-17 21:17
maketemp.pl
424
B
-rwxr-xr-x
2026-07-17 21:17
mime.types
12.42
KB
-rw-r--r--
2026-07-17 21:17
miniserv-lib.pl
175.51
KB
-rw-r--r--
2026-07-17 21:17
miniserv.pem
2.9
KB
-rw-r--r--
2026-07-17 21:17
miniserv.pl
33.88
KB
-rwxr-xr-x
2026-07-17 21:22
module_chooser.cgi
4.14
KB
-rwxr-xr-x
2026-07-17 21:22
negativeacl
29
B
-rw-r--r--
2026-07-17 21:17
newmods.pl
1.25
KB
-rwxr-xr-x
2026-07-17 21:17
os_eol.json
50.05
KB
-rw-r--r--
2026-07-17 21:17
os_list.txt
35.22
KB
-rw-r--r--
2026-07-17 21:17
oschooser.pl
4.55
KB
-rwxr-xr-x
2026-07-17 21:22
pam_login.cgi
4.33
KB
-rwxr-xr-x
2026-07-17 21:22
password_change.cgi
7.02
KB
-rwxr-xr-x
2026-07-17 21:22
password_form.cgi
1.3
KB
-rwxr-xr-x
2026-07-17 21:22
perlpath.pl
571
B
-rwxr-xr-x
2026-07-17 21:22
record-failed.pl
503
B
-rwxr-xr-x
2026-07-17 21:22
record-login.pl
513
B
-rwxr-xr-x
2026-07-17 21:22
record-logout.pl
516
B
-rwxr-xr-x
2026-07-17 21:22
robots.txt
26
B
-rw-r--r--
2026-07-17 21:17
rpc.cgi
4.03
KB
-rwxr-xr-x
2026-07-17 21:22
run-postinstalls.pl
971
B
-rwxr-xr-x
2026-07-17 21:22
run-uninstalls.pl
1004
B
-rwxr-xr-x
2026-07-17 21:22
safeacl
73
B
-rw-r--r--
2026-07-17 21:17
session_login.cgi
5.11
KB
-rwxr-xr-x
2026-07-17 21:22
setup-repos.sh
766
B
-rw-r--r--
2026-07-17 21:17
setup.bat
3.08
KB
-rw-r--r--
2026-07-17 21:17
setup.pl
32.4
KB
-rwxr-xr-x
2026-07-17 21:22
setup.sh
35.21
KB
-rwxr-xr-x
2026-07-17 21:17
switch_theme.cgi
1.22
KB
-rwxr-xr-x
2026-07-17 21:22
switch_user.cgi
404
B
-rwxr-xr-x
2026-07-17 21:22
thirdparty.pl
1.73
KB
-rwxr-xr-x
2026-07-17 21:17
ui-lib.pl
123.52
KB
-rwxr-xr-x
2026-07-17 21:17
update-from-repo.sh
14.77
KB
-rwxr-xr-x
2026-07-17 21:17
uptracker.cgi
2.89
KB
-rwxr-xr-x
2026-07-17 21:22
user_chooser.cgi
7.39
KB
-rwxr-xr-x
2026-07-17 21:22
version
6
B
-rw-r--r--
2026-07-17 21:17
web-lib-funcs.pl
417.23
KB
-rwxr-xr-x
2026-07-17 21:17
web-lib.pl
856
B
-rwxr-xr-x
2026-07-17 21:17
webmin-daemon
80
B
-rw-r--r--
2026-07-17 21:17
webmin-init
1.93
KB
-rwxr-xr-x
2026-07-17 21:17
webmin-pam
101
B
-rw-r--r--
2026-07-17 21:17
webmin-search-lib.pl
9.47
KB
-rwxr-xr-x
2026-07-17 21:17
webmin-systemd
374
B
-rw-r--r--
2026-07-17 21:17
webmin_search.cgi
2.63
KB
-rwxr-xr-x
2026-07-17 21:22
xmlrpc.cgi
4.14
KB
-rwxr-xr-x
2026-07-17 21:22
Save
Rename
#!/usr/bin/env bash ############################################################################# # Update webmin/usermin to the latest develop version from GitHub repo # inspired by authentic-theme/theme-update.sh script, thanks @iliajie # VERS="1.6.10, 2023-11-16" # COPY=" Kay Marquardt <kay@rrr.de> https://github.com/gnadelwartz" ############################################################################# IAM=`basename $0` # don't ask -y given ASK="YES" if [[ "$1" == "-y" || "$1" == "-yes" || "$1" == "-f" || "$1" == "-force" ]] ; then ASK="NO" shift fi if [[ "$1" == "-nc" ]] ; then NCOLOR="YES" shift fi # predefined colors for echo -e on terminal if [[ -t 1 && "${NCOLOR}" != "YES" ]] ; then RED='\e[49;0;31;82m' BLUE='\e[49;1;34;182m' GREEN='\e[49;32;5;82m' ORANGE='\e[49;0;33;82m' PURPLE='\e[49;1;35;82m' LGREY='\e[49;1;37;182m' GREY='\e[1;30m' CYAN='\e[36m' NC='\e[0m' fi # Get webmin/usermin dir based on script's location DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PROD="webmin" # default if [[ -r "${DIR}/uconfig.cgi" ]] ; then if [[ -d "${DIR}/webmin" ]] ; then echo -e "${RED}Error: found Usermin but also Webmin files. aborting ...${NC}" exit 1 fi PROD="usermin" else if [[ -d "${DIR}/language" ]] ; then echo -e "${RED}Error: found Webmin but also Usermin files. aborting ...${NC}" exit 1 fi PROD="webmin" fi echo -e "${ORANGE}${PROD^} detected ...${NC}" # where to get source HOST="https://github.com" REPO="webmin/$PROD" GIT="git" CURL="curl" BRANCH="" # temporary locations for git clone WTEMP="${DIR}/.~files/webadmin" UTEMP="${DIR}/.~files/useradmin" TEMP=$WTEMP [[ "$PROD" == "usermin" ]] && TEMP=$UTEMP LTEMP="${DIR}/.~lang" # help requested output usage if [[ "$1" == "-h" || "$1" == "--help" ]] ; then if [[ "$1" != "--help" ]] ; then echo -e "${NC}${ORANGE}This is the webmin develop update script, ${VERS}${NC}" echo "Usage: ${IAM} [-force] [-repo:username/xxxmin] [-branch:xxx] [-release[:number]] [-file file|dir/ ...]" else cat <<EOF | more ${IAM} ${VERS} Name: update-from-repo.sh - webmin script to pull new versions or files from repo Usage: ${IAM} [-force] [-repo:username/xxxmin] [-branch:xxx] [-release[:number]] [-file file|dir/ ...] [-h|--help] Parameters: -force (-yes) unattended install, do not ask -nc or STDOUT is a pipe (|) do not output colors -repo pull from alternative github repo, format: -repo:username/reponame reponame must be "webmin" or "usermin" default github repo: webmin/webmin -branch pull given branch from repository -release pull a released version, default: -release:latest -file pull only the given file(s) or dir(s)/ from repo dir has to be specified with trailing '/' file or dir/ must not start with a slash and must not contain '../' -h short usage line --help display this help page Examples: ${IAM} update everthing from default webmin repository ${IAM} -force OR ${IAM} -yes same but without asking, ${IAM} -force -repo:webmin/webmin update from webmin's repository without asking ${IAM} -file module/module.info pull module.info for given module ${IAM} -file cpan/ pull everything in dir cpan ${IAM} -file cpan/* pull only already existing files in cpan ${IAM} -file module/lang/ pull all files in lang/ dir of a module ${IAM} -fore -repo:webmin/webmin -file */lang/ pull lang files for all existing */lang/ dirs from webmin repository without asking Exit codes: 0 - success 1 - abort on error or user request, nothing changed 2 - not run as root 3 - git not found 4 - stage 1: git clone failed 5 - stage 2: makedist failed 6 - stage 3: update with setup.sh failed, installation may in bad state! Author: ${COPY} EOF fi exit 0 fi # check for required webmin / usermin files in current dir if [[ ! -r "${DIR}/setup.sh" || ! -r "${DIR}/miniserv.pl" || ! -d "${DIR}/authentic-theme" ]] ; then echo -e "${NC}${RED}Error: the current dir does not contain a valid webmin or usermin installation, aborting ...${NC}" exit 1 fi # need to be root if [[ $EUID -ne 0 ]]; then echo -e "${RED}Error: This command has to be run under the root user. aborting ...${NC}" exit 2 fi # search for config location echo -en "${CYAN}Search for ${RPOD^} configuration ... ${NC}" for conf in /etc/${PROD} /var/packages/${PROD}/target/etc do if [[ -r "${conf}/miniserv.conf" ]] ; then MINICONF="${conf}/miniserv.conf" echo -e "${ORANGE}found: ${MINICONF}${NC}" break fi done # check for other locations if not in default if [[ "${MINICONF}" == "" ]] ; then MINICONF=`find /* -maxdepth 6 -regex ".*/${PROD}.*/miniserv\.conf" 2>/dev/null | grep ${PROD} | head -n 1` echo -e "${ORANGE}found: ${MINICONF}${NC} (alternative location)" fi # check if miniserv.conf found if [[ "${MINICONF}" != "" ]] ; then # add PATH from config to system PATH export PATH="${PATH}:`grep path= ${MINICONF} | sed 's/^path=//'`" ETC="`grep env_WEBMIN_CONFIG= ${MINICONF} | sed 's/^env_WEBMIN_CONFIG=//'`" echo -e "${ORANGE}Config path for ${PROD^} is: ${NC} ${ETC}" echo -e "${ORANGE}Install path for ${PROD^} is:${NC} ${DIR}\n" else echo -e "${RED}Error: found no miniserv configuration. aborting ...${NC}" exit 1 fi # check if PROD is in ETC and DIR if [[ "${ETC}" != *"${RPOD}"* || "${DIR}" != *"${RPOD}"* ]] ; then echo -e "${RED}Warning:${ORANGE} Config or Install path does not contain \"${PROD}\"!${NC} consider to ${ORANGE}NOT${NC} update!\n" WARNINGS="yes" fi # check if git is availible if type ${GIT} >/dev/null 2>&1 ; then true else echo -e "${RED}Error: Command \`git\` is not installed or not in the \`PATH\`. aborting ...${NC}" exit 3 fi # check if curl is availible if type ${CURL} >/dev/null 2>&1 ; then true else # flag as not availible, not needed without -repo or -release:latest CURL="" fi ################ # lets start # alternative repo given if [[ "$1" == "-repo"* ]]; then if [[ "$1" == *":"* ]] ; then REPO=${1##*:} if [[ "${REPO##*/}" != "webmin" && "${REPO##*/}" != "usermin" ]] ; then echo -e "${RED}Error: \"${REPO}\" is not a valid repository name! aborting ...${NC}" exit 1 fi if [[ "${REPO##*/}" != "${PROD}" ]] ; then echo -e "${RED}Error: \"${REPO}\" is not a valid ${PROD^} repository name! aborting ...${NC}" exit 1 fi shift else echo -e "${RED}Error: Missing argument for parameter \"-repo\". aborting ...${NC}" exit 1 fi fi # alternative branch given if [[ "$1" == *"-branch"* ]]; then if [[ "$1" == *":"* ]] ; then BRANCH=" --branch ${1##*:}" shift else echo -e "${ORANGE}./`basename $0`:${NC} Missing argument for parameter -branch aborting ..." exit 1 fi fi # warn about possible side effects because webmins makedist.pl try cd to /usr/local/webmin (and more) [[ -d "/usr/local/webadmin" ]] && echo -e "${RED}Warning:${ORANGE} Develop dir /usr/local/webadmin exist, update may fail!${NC}" ################ # really update? REPLY="y" if [ "${ASK}" == "YES" ] ; then if [[ "$1" != "-release"* ]] ; then echo -e "${RED}Warning:${ORANGE} you are updating from DEV repository${NC} ${HOST}/${REPO}${BRANCH} ${ORANGE}, this may break your installation!${NC}" fi read -p "Would you like to update "${PROD^}" from ${HOST}/${REPO}${BRANCH} [y/N] " -n 1 -r echo fi if [[ ! $REPLY =~ ^[Yy]$ ]]; then # something different the y entered echo -e "${PURPLE}Operation aborted.${NC}" exit 1 fi ################ # here we go # Enter to the dir first - important if run from different location cd ${DIR} # remove temporary files from failed run rm -rf .~files # pull source from github if [[ "$1" == *"-release"* ]]; then if [[ "$1" == *":"* ]] && [[ "$1" != *"latest"* ]]; then RRELEASE=${1##*:} elif [[ "${CURL}" != "" ]] ; then RRELEASE="$(${CURL} -s -L https://raw.githubusercontent.com/${REPO}/master/version)" else echo -e "${RED}Error: Command \`curl\` is not installed or not in the \`PATH\`.${NC} try with -release:1.881" exit 3 fi shift echo -e "${CYAN}Pulling in latest release of${NC} ${ORANGE}${PROD^}${NC} $RRELEASE ($HOST/$REPO)..." RS="$(${GIT} clone --depth 1 --branch $RRELEASE -q $HOST/$REPO.git "${TEMP}" 2>&1)" if [[ "$RS" == *"ould not find remote branch"* ]]; then ERROR="Release ${RRELEASE} doesn't exist. " fi else echo -e "${CYAN}Pulling in latest changes for${NC} ${ORANGE}${PROD^}${NC} $RRELEASE (${HOST}/${REPO}${BRANCH}) ..." ${GIT} clone --depth 1 --quiet ${BRANCH} $HOST/$REPO.git "${TEMP}" fi # on usermin!! pull also webmin to resolve symlinks later! WEBMREPO=`echo ${REPO} | sed "s/\/usermin$/\/webmin/"` if [[ "${REPO}" != "${WEBMREPO}" ]]; then echo -e "${CYAN}Pulling also latest changes for${NC} ${ORANGE}Webmin${NC} ($HOST/$WEBMREPO) ..." ${GIT} clone --depth 1 --quiet $HOST/$WEBMREPO.git "${WTEMP}" fi # Check for possible errors if [ $? -eq 0 ] && [ -f "${TEMP}/version" ]; then #################### # start processing pulled source # add latest changeset date to original version, works with git 1.7+ if [[ "${RRELEASE}" == "" ]] ; then version="`head -n 1 ${TEMP}/version``cd ${TEMP}; ${GIT} log -n1 --pretty='format:%cd' --date=format:'%m%d%H%M'`" else version="${RRELEASE}" fi DOTVER=`echo ${version} | sed 's/-/./'` TARBALL="${TEMP}/tarballs/${PROD}-${DOTVER}" ############### # start update echo -en "${CYAN}Start update for${NC} ${PROD^} ${version}..." # create missing dirs, simulate authentic present mkdir ${TEMP}/tarballs ${TEMP}/authentic-theme cp authentic-theme/LICENSE ${TEMP}/authentic-theme # put dummy clear and tar in PATH echo -e "#!/bin/sh\necho" > ${TEMP}/clear; chmod +x ${TEMP}/clear echo -e "#!/bin/sh\necho" > ${TEMP}/tar; chmod +x ${TEMP}/tar export PATH="${TEMP}:${PATH}" # run makedist.pl ( cd ${TEMP}; perl makedist.pl ${DOTVER} 2>&1) | while read input; do echo -n "."; done echo -e "\n" if [[ ! -f "${TARBALL}.tar.gz" ]] ; then echo -e "${RED}Error: makedist.pl failed! ${NC}aborting ..." rm -rf .~files exit 5 fi rm -rf ${TEMP}/tar # check for additional standard modules not in default dist for module in `ls */module.info` do if [[ -f ${TEMP}/${module} && ! -f "${TARBALL}/$module" ]]; then module=`dirname $module` echo -e "${CYAN}Adding nonstandard${NC} ${ORANGE}$module${NC} to ${PROD^}" cp -r -L ${TEMP}/${module} ${TARBALL}/ fi done # insert perl path config_dir=`grep env_WEBMIN_CONFIG= ${MINICONF}| sed 's/.*_WEBMIN_CONFIG=//'` perl=`cat $config_dir/perl-path` echo -e "${CYAN}Insert perl path${NC} ${perl} ..." ( cd ${TARBALL}; sed -i --follow-symlinks "1 s|#\!/.*$|#!${perl}|" `find . -name '*.cgi' ; find . -name '*.pl'` ) # copy all or only given files ... if [[ "$1" != "-file" ]] ; then ############ # prepeare unattended FULL upgrade echo "${version}" >"${TARBALL}/version" atboot="NO" makeboot="NO" nouninstall="YES" [[ -x "${perl}" ]] && noperlpath="YES" #nostart="YES" export config_dir atboot nouninstall makeboot nostart noperlpath ( cd ${TARBALL}; ./setup.sh ${DIR} ) | grep -v -e "^$" -e "done$" -e "chmod" -e "chgrp" -e "chown" if [[ "${TARBALL}/version" -nt "${MINICONF}" ]] ; then echo -e "${RED}Error: update failed, ${PROD} may in a bad state! ${NC}aborting ..." rm -rf .~files exit 6 fi # run authenric-thme update, possible unattended if [[ -x authentic-theme/theme-update.sh ]] ; then if [[ "${ASK}" == "YES" ]] ; then authentic-theme/theme-update.sh else yes | authentic-theme/theme-update.sh fi fi else ################## # pull specified files only shift FILES="$*" for file in ${FILES} do # check for / and ../ if [[ "${file}" == "/"* || "${file}" == *"../"* ]] ; then echo -e "${RED}Warning:${ORANGE} / and ../ are not allowed!${NC} skipping ${file} ..." WARNINGS="yes" continue fi if [[ "$file" == *"/" && -d "${TARBALL}/${file}" ]] ; then echo -e "${BLUE}Copy dir ${ORANGE}${file}${NC} from ${ORANGE}${REPO}${NC} to ${PROD^} ..." dest=${file%%/*} [[ "${dest}" == "${file}" ]] && dest="." cp -r "${TARBALL}/${file}" "${dest}" | sed 's/^.*\/tarballs\///' FOUND="${FOUND}${file} " else if [ -f "${TARBALL}/${file}" ] ; then echo -e "${CYAN}Copy file ${ORANGE}${file}${NC} from ${ORANGE}${REPO}${NC} to ${PROD^} ..." mv "${file}" "${file}.bak" cp "${TARBALL}/${file}" "${file}" if [[ "$?" -eq "0" ]] ; then rm -rf "${file}.bak" else echo -e "${RED}Warning:${ORANGE} cp ${file} failed,${NC} restore original!" WARNINGS="yes" fi FOUND="${FOUND}${file} " elif [[ ! -d "${TARBALL}/${file}" ]] ; then echo -e "${RED}Warning:${ORANGE} No such file or directory: ${file},${NC} skipping ..." WARNINGS="yes" fi fi done FILES='$*' # restart webmin if [[ -d "${ETC}" ]] ; then echo ${ETC}/restart fi fi else # something went wrong echo -e "${RED}${ERROR} Error: update failed:${NC}${ORANGE} ${GIT} clone ${BRANCH} $RRELEASE $HOST/$REPO.git ${NC}" exit 4 fi ########### # we are at the end, clean up # remove temporary files echo -e "\n${CYAN}Clean up temporary files ...${NC}" rm -rf .~files # fix permissions, should be done by makedist.pl? echo -e "${CYAN}Make scripts executable ...${NC}" chmod -R +X ${DIR} chmod +x *.pl *.cgi *.pm *.sh */*.pl */*.cgi */*.pm */*.sh # thats all folks [[ "${WARNINGS}" != "" ]] && WARNINGS="(with warnings)" echo -e "\n${CYAN}Updating ${PROD^} ${ORANGE}${FOUND}${NC} to Version `cat version`, done ${RED}${WARNINGS}${NC}" # update success exit 0