nutools/lib/uinst/rootconf

74 lines
2.2 KiB
Plaintext
Raw Normal View History

2013-08-27 15:14:44 +04:00
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$@" || exit 1
source "$ULIBDIR/ulib" && urequire DEFAULTS || exit 1
cd "$scriptdir/../../"
log=/tmp/nutools-pyulib-install.log
etitle -s "Installation des packages python"
enote "Le log de l'installation se trouve dans $log"
./uinst -y pyulib >&"$log"
eend
# setup.py laisse des fichiers avec les droits de root, et ces fichiers ne
# peuvent être supprimés par l'utilisateur qui lance uinst. Les supprimer ici.
rm -rf pyulib/build
dest="@@dest@@"
for i in ulib ulibsh; do
sed "s|@@""dest""@@|$dest|g" "ulib/$i" >"/etc/$i"
done
2013-09-21 07:28:48 +04:00
cp ulib/.ulib_version /etc/.ulib_version
2013-08-27 15:14:44 +04:00
echo >/etc/ulibauto '# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
if [ x"$BASH" != x -a -f /etc/ulib ]; then
. /etc/ulib
elif [ x"$BASH" = x -a -f /etc/ulibsh ]; then
. /etc/ulibsh
else
echo "error: Unable to find required file /etc/ulib" 1>&2
exit 1
fi
uprovide ulibauto
urequire DEFAULTS'
if [ -n "$uninst_utools" ]; then
etitle "Désinstallation de la configuration de utools"
array_from_lines userinfos "$(</etc/passwd awkrun FS=: '$3 == "0" || $6 ~ /^\/home\// { print $1 ":" $6 }')"
for userinfo in "${userinfos[@]}"; do
splitpair "$userinfo" username homedir
[ -d "$homedir/etc/profile.d" -a -d "$homedir/etc/bashrc.d" ] || continue
etitle "$username"
for i in \
profile.d/{backup.userconf,utools,utools.userconf} \
bashrc.d/utools_options.userconf \
default/{apache,backup,webobjects} \
; do
i="$homedir/etc/$i"
[ -f "$i" ] || continue
estep "rm $i"
rm "$i"
done
if [ "$username" == root ]; then
"$dest/uenv"
else
su "$username" "$dest/uenv"
fi
eend
done
eend
fi
if [ -n "$rm_utools" ]; then
etitle "Suppression de /usr/local/utools"
rm -rf /usr/local/utools
eend
fi
[ -n "$kvm_service" ] &&
etitle "Installation de /etc/init.d/kvm-stop-all" \
"$scriptdir/../init.d/install-kvm-stop-all"
[ -n "$openvz_service" ] &&
etitle "Installation de /etc/init.d/openvz-fix-etchosts" \
"$scriptdir/../init.d/install-openvz-fix-etchosts"