| Line 1... |
Line 1... |
| 1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
| 2 |
# $Id: alcasar.sh 2211 2017-05-08 16:39:43Z richard $
|
2 |
# $Id: alcasar.sh 2213 2017-05-08 21:55:08Z 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 2023... |
Line 2023... |
| 2023 |
echo "net.ipv6.conf.default.autoconf = 0" >> /etc/sysctl.d/alcasar.conf
|
2023 |
echo "net.ipv6.conf.default.autoconf = 0" >> /etc/sysctl.d/alcasar.conf
|
| 2024 |
# switch to multi-users runlevel (instead of x11)
|
2024 |
# switch to multi-users runlevel (instead of x11)
|
| 2025 |
ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
|
2025 |
ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
|
| 2026 |
# GRUB modifications (only one time)
|
2026 |
# GRUB modifications (only one time)
|
| 2027 |
# Limit wait time to 3s - Create an alcasar entry instead of linux-nonfb - Change the default banner
|
2027 |
# Limit wait time to 3s - Create an alcasar entry instead of linux-nonfb - Change the default banner
|
| - |
|
2028 |
vm_vga=`lsmod | egrep "virtio|vmwgfx" | wc -l` # test if in VM
|
| 2028 |
grub_already_modified=`grep ALCASAR /boot/grub/menu.lst|wc -l`
|
2029 |
grub_already_modified=`grep ALCASAR /boot/grub/menu.lst|wc -l`
|
| - |
|
2030 |
[ -e /etc/mageia-release.default ] || cp /etc/mageia-release /etc/mageia-release.default
|
| 2029 |
if [ $grub_already_modified == 0 ]
|
2031 |
if [ $grub_already_modified == 0 ]
|
| 2030 |
then
|
2032 |
then
|
| 2031 |
$SED "s?^timeout.*?timeout 3?g" /boot/grub/menu.lst
|
2033 |
$SED "s?^timeout.*?timeout 3?g" /boot/grub/menu.lst
|
| 2032 |
$SED "s?^title linux?title ALCASAR?g" /boot/grub/menu.lst
|
2034 |
$SED "s?^title linux?title ALCASAR?g" /boot/grub/menu.lst
|
| 2033 |
$SED "/^kernel/s/splash quiet //" /boot/grub/menu.lst
|
2035 |
$SED "/^kernel/s/splash quiet //" /boot/grub/menu.lst
|
| 2034 |
# change display to 1024*768 (vga791) only if not on VM
|
- |
|
| 2035 |
[ -e /etc/mageia-release.default ] || cp /etc/mageia-release /etc/mageia-release.default
|
- |
|
| 2036 |
vm_vga=`lsmod | egrep "virtio|vmwgfx" | wc -l`
|
- |
|
| 2037 |
if [ $vm_vga == 0 ] # is not a virtual machine (proxmox, vmware)
|
2036 |
if [ $vm_vga == 0 ] # is not a VM
|
| 2038 |
then
|
2037 |
then
|
| 2039 |
$SED "/^kernel/s/$/ vga=791/" /boot/grub/menu.lst
|
2038 |
$SED "/^kernel/s/$/ vga=791/" /boot/grub/menu.lst # change display to 1024*768 (vga791) only if not on VM
|
| 2040 |
cp -f $DIR_CONF/banner /etc/mageia-release
|
- |
|
| 2041 |
echo " V$VERSION" >> /etc/mageia-release
|
- |
|
| 2042 |
else
|
- |
|
| 2043 |
echo "ALCASAR V$VERSION" > /etc/mageia-release
|
- |
|
| 2044 |
fi
|
2039 |
fi
|
| 2045 |
$SED "/^kernel/s/BOOT_IMAGE=linux /BOOT_IMAGE=linux-nonfb /" /boot/grub/menu.lst
|
- |
|
| 2046 |
$SED "/^gfxmenu/d" /boot/grub/menu.lst
|
- |
|
| 2047 |
fi
|
2040 |
fi
|
| - |
|
2041 |
if [ $vm_vga == 0 ] # is not a VM
|
| - |
|
2042 |
then
|
| - |
|
2043 |
cp -f $DIR_CONF/banner /etc/mageia-release
|
| - |
|
2044 |
echo " V$VERSION" >> /etc/mageia-release
|
| - |
|
2045 |
else
|
| - |
|
2046 |
echo "ALCASAR V$VERSION" > /etc/mageia-release
|
| - |
|
2047 |
fi
|
| - |
|
2048 |
$SED "/^kernel/s/BOOT_IMAGE=linux /BOOT_IMAGE=linux-nonfb /" /boot/grub/menu.lst
|
| - |
|
2049 |
$SED "/^gfxmenu/d" /boot/grub/menu.lst
|
| 2048 |
# Load and apply the previous conf file
|
2050 |
# Load and apply the previous conf file
|
| 2049 |
if [ "$mode" = "update" ]
|
2051 |
if [ "$mode" = "update" ]
|
| 2050 |
then
|
2052 |
then
|
| 2051 |
$DIR_DEST_BIN/alcasar-archive.sh --now # exports current logs in /var/Save/archive
|
2053 |
$DIR_DEST_BIN/alcasar-archive.sh --now # exports current logs in /var/Save/archive
|
| 2052 |
$DIR_DEST_BIN/alcasar-conf.sh --load
|
2054 |
$DIR_DEST_BIN/alcasar-conf.sh --load
|