Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 2432 2017-10-22 20:56:33Z richard $
|
2 |
# $Id: alcasar.sh 2433 2017-10-30 23:02:21Z richard $
|
3 |
|
3 |
|
4 |
# alcasar.sh
|
4 |
# alcasar.sh
|
5 |
|
5 |
|
6 |
# ALCASAR Install script - CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...]
|
6 |
# ALCASAR Install script - CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...]
|
7 |
# Ce programme est un logiciel libre ; This software is free and open source
|
7 |
# Ce programme est un logiciel libre ; This software is free and open source
|
Line 393... |
Line 393... |
393 |
grep -v '[eE]nter password:' | \
|
393 |
grep -v '[eE]nter password:' | \
|
394 |
sed -e "s/PBKDF2 hash of your password is //"`
|
394 |
sed -e "s/PBKDF2 hash of your password is //"`
|
395 |
echo "GRUB2_PASSWORD=$pbkdf2" > /boot/grub2/user.cfg
|
395 |
echo "GRUB2_PASSWORD=$pbkdf2" > /boot/grub2/user.cfg
|
396 |
[ -e /etc/grub.d/default-10_linux ] || cp /etc/grub.d/10_linux /etc/grub.d/default-10_linux
|
396 |
[ -e /etc/grub.d/default-10_linux ] || cp /etc/grub.d/10_linux /etc/grub.d/default-10_linux
|
397 |
cp -f $DIR_CONF/grub-10_linux /etc/grub.d/10_linux # Request password only on menu editing attempts (not when selecting an entry)
|
397 |
cp -f $DIR_CONF/grub-10_linux /etc/grub.d/10_linux # Request password only on menu editing attempts (not when selecting an entry)
|
398 |
/usr/bin/update-grub2
|
- |
|
399 |
chmod 0600 /boot/grub2/user.cfg
|
398 |
chmod 0600 /boot/grub2/user.cfg
|
400 |
echo "# Login name and password to protect GRUB2 boot menu (!!!qwerty keyboard) : " > $PASSWD_FILE
|
399 |
echo "# Login name and password to protect GRUB2 boot menu (!!!qwerty keyboard) : " > $PASSWD_FILE
|
401 |
echo "GRUB2_user=root" >> $PASSWD_FILE
|
400 |
echo "GRUB2_user=root" >> $PASSWD_FILE
|
402 |
echo "GRUB2_password=$grub2pwd" >> $PASSWD_FILE
|
401 |
echo "GRUB2_password=$grub2pwd" >> $PASSWD_FILE
|
403 |
mysqlpwd=`cat /dev/urandom | tr -dc [:alnum:] | head -c16`
|
402 |
mysqlpwd=`cat /dev/urandom | tr -dc [:alnum:] | head -c16`
|
Line 2187... |
Line 2186... |
2187 |
# switch to multi-users runlevel (instead of x11)
|
2186 |
# switch to multi-users runlevel (instead of x11)
|
2188 |
ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
|
2187 |
ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
|
2189 |
# GRUB2 modifications (Wait time : 3s - ALCASAR entry - VGA=791 - Change the default banner
|
2188 |
# GRUB2 modifications (Wait time : 3s - ALCASAR entry - VGA=791 - Change the default banner
|
2190 |
[ -e /etc/default/grub.default ] || cp /etc/default/grub /etc/default/grub.default
|
2189 |
[ -e /etc/default/grub.default ] || cp /etc/default/grub /etc/default/grub.default
|
2191 |
$SED "s?^GRUB_TIMEOUT=.*?GRUB_TIMEOUT=3?g" /etc/default/grub
|
2190 |
$SED "s?^GRUB_TIMEOUT=.*?GRUB_TIMEOUT=3?g" /etc/default/grub
|
2192 |
$SED "s?^GRUB_DISTRIBUTOR=.*?GRUB_DISTRIBUTOR=ALCASAR (on Mageia)?g" /etc/default/grub/
|
2191 |
$SED "s?^GRUB_DISTRIBUTOR=.*?GRUB_DISTRIBUTOR=ALCASAR?g" /etc/default/grub
|
2193 |
[ -e /etc/mageia-release.default ] || cp /etc/mageia-release /etc/mageia-release.default
|
2192 |
[ -e /etc/mageia-release.default ] || cp /etc/mageia-release /etc/mageia-release.default
|
2194 |
vm_vga=`lsmod | egrep -c "virtio|vmwgfx"` # test if in VM
|
2193 |
vm_vga=`lsmod | egrep -c "virtio|vmwgfx"` # test if in VM
|
2195 |
if [ $vm_vga == 0 ] # is not a VM
|
2194 |
if [ $vm_vga == 0 ] # is not a VM
|
2196 |
then
|
2195 |
then
|
2197 |
cp -f $DIR_CONF/banner /etc/mageia-release # ALCASAR ASCII-Art
|
2196 |
cp -f $DIR_CONF/banner /etc/mageia-release # ALCASAR ASCII-Art
|
2198 |
echo >> /etc/mageia-release
|
2197 |
echo >> /etc/mageia-release
|
2199 |
$SED "s?ĜRUB_CMDLINE_LINUX_DEFAULT=\"?&vga=791 ?" /etc/default/grub
|
2198 |
$SED "s?^GRUB_CMDLINE_LINUX_DEFAULT=\"?&vga=791 ?" /etc/default/grub
|
2200 |
fi
|
2199 |
fi
|
2201 |
if [ $Lang == "fr" ]
|
2200 |
if [ $Lang == "fr" ]
|
2202 |
then
|
2201 |
then
|
2203 |
echo "Bienvenue sur ALCASAR V$VERSION" >> /etc/mageia-release
|
2202 |
echo "Bienvenue sur ALCASAR V$VERSION" >> /etc/mageia-release
|
2204 |
echo "Connectez-vous à l'URL 'http://alcasar.localdomain/acc'" >> /etc/mageia-release
|
2203 |
echo "Connectez-vous à l'URL 'https://alcasar.localdomain/acc'" >> /etc/mageia-release
|
2205 |
else
|
2204 |
else
|
2206 |
echo "Welcome on ALCASAR V$VERSION" >> /etc/mageia-release
|
2205 |
echo "Welcome on ALCASAR V$VERSION" >> /etc/mageia-release
|
2207 |
echo "Connect to 'http://alcasar.localdomain/acc'" >> /etc/mageia-release
|
2206 |
echo "Connect to 'https://alcasar.localdomain/acc'" >> /etc/mageia-release
|
2208 |
fi
|
2207 |
fi
|
- |
|
2208 |
/usr/bin/update-grub2
|
2209 |
# Load and apply the previous conf file
|
2209 |
# Load and apply the previous conf file
|
2210 |
if [ "$mode" = "update" ]
|
2210 |
if [ "$mode" = "update" ]
|
2211 |
then
|
2211 |
then
|
2212 |
$DIR_DEST_BIN/alcasar-archive.sh --now # exports current logs in /var/Save/archive
|
2212 |
$DIR_DEST_BIN/alcasar-archive.sh --now # exports current logs in /var/Save/archive
|
2213 |
$DIR_DEST_BIN/alcasar-conf.sh --load
|
2213 |
$DIR_DEST_BIN/alcasar-conf.sh --load
|