Archived
1
0
Fork 0
This repository has been archived on 2021-10-08. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
ACU/commands/first-install.sh
Mercier Pierre-Olivier 01b8f4327a Launch on ksh
2013-09-20 03:39:10 +02:00

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!"