| Server IP : 82.148.16.210 / Your IP : 216.73.216.19 Web Server : nginx/1.29.5 System : Linux mail.sarafai.ru 6.1.0-43-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.162-1 (2026-02-08) x86_64 User : root ( 0) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/local/bin/ |
Upload File : |
#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
SCRIPTNAME=$(basename $0)
function show_options () {
echo "Usage: $SCRIPTNAME -d <directory>"
echo
echo "Options:"
echo " -d -- directory to search for package-installs-* files"
exit 1
}
TEMP=$(getopt -o hd: -n $SCRIPTNAME -- "$@")
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$TEMP"
WORKDIR=
while true ; do
case "$1" in
-d) WORKDIR=$2; shift 2;;
-h) show_options;;
--) shift ; break ;;
*) echo "Error: unsupported option $1."; exit 1;;
esac
done
if [ -z "$WORKDIR" ]; then
show_options
fi
PACKAGES=
for PACKAGEFILE in $(find $WORKDIR -maxdepth 1 -name "package-installs-*" ); do
basefile=$(basename $PACKAGEFILE)
element_name=${basefile#"package-installs-"}
while read pkg; do
if [ -z "$pkg" ]; then
continue
fi
# Ignore comments
if [ ${pkg:0:1} = "#" ]; then
continue
fi
if [ ${pkg:0:1} = "-" ]; then
pkg=${pkg:1}
fi
if [ -e /usr/share/pkg-map/$element_name ]; then
# map the package to its true name
set +e
map_pkg=$(pkg-map --element $element_name $pkg)
if [ $? -eq 0 ]; then
pkg=$map_pkg
fi
set -e
fi
PACKAGES="$PACKAGES $pkg"
done < $PACKAGEFILE
done
if [ -n "$PACKAGES" ]; then
install-packages $PACKAGES
fi