64 lines
1.3 KiB
Bash
Executable file
64 lines
1.3 KiB
Bash
Executable file
#! /bin/bash
|
|
|
|
# Install missing packets
|
|
DEB_PACKAGES_LIST="screen libnet-ldap-perl libxml-libxml-perl libgearman-client-perl libmailtools-perl libmail-sendmail-perl libdate-manip-perl"
|
|
ARCH_PACKAGES_LIST="screen perl-io-socket-ssl perl-email-simple perl-email-mime perl-term-readkey perl-ldap perl-lwp-protocol-https"
|
|
|
|
if [ -f "/etc/debian_version" ]
|
|
then
|
|
|
|
if ! whereis dpkg > /dev/null 2> /dev/null
|
|
then
|
|
aptitude install dpkg
|
|
fi
|
|
|
|
for PK in $DEB_PACKAGES_LIST
|
|
do
|
|
if ! dpkg -l | grep "^ii" | grep "$PK" > /dev/null 2> /dev/null
|
|
then
|
|
aptitude install "$PK"
|
|
fi
|
|
done
|
|
|
|
|
|
# Add intradmin user if missing
|
|
if ! getent passwd | grep "intradmin:" > /dev/null 2> /dev/null
|
|
then
|
|
useradd --shell /bin/false --uid 942 intradmin &&
|
|
mkdir -p /home/intradmin
|
|
fi
|
|
|
|
chown -R intradmin:intradmin /home/intradmin
|
|
|
|
elif [ -f "/etc/arch-release" ]
|
|
then
|
|
|
|
for PK in $ARCH_PACKAGES_LIST
|
|
do
|
|
if ! pacman -Qi "$PK" > /dev/null 2> /dev/null
|
|
then
|
|
pacman -S "$PK"
|
|
fi
|
|
done
|
|
|
|
elif [ -f "/etc/freebsd-update.conf" ]
|
|
then
|
|
|
|
echo "TODO: FreeBSD"
|
|
exit 1;
|
|
|
|
else
|
|
|
|
echo "Unknown operating system :("
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
# Git ?
|
|
if egrep '^git:' /etc/passwd > /dev/null
|
|
then
|
|
mkdir -p /var/log/hooks/ &&
|
|
chown git /var/log/hooks/
|
|
fi
|
|
|
|
echo "System ready!"
|