flavors view dolibarr/distro.sh @ rev 269

core, xorg-light: remove sudoku
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Feb 10 10:11:33 2020 +0100 (2020-02-10)
parents 027d6ceef993
children
line source
1 #!/bin/sh
2 # distro.sh, changeset for slitaz-dolibarr
3 #
4 # Eric Joseph-Alexandre <erjo@slitaz.org>
6 ROOTFS=$PWD/rootfs
7 HOSTNAME="dolilive"
8 AUTOSTART="apache mysql"
9 DONTSTART="httpd"
10 ALLOW_ROOT_LOGIN="1"
11 BLOCKED_PACKAGES=""
13 # Disable auto-install dependencies
14 sed -i s/AUTO_INSTALL.*/AUTO_INSTALL_DEPS=\"no\"/ $ROOTFS/etc/slitaz/tazpkg.conf
16 ##
17 ##
18 if [ ! -z "$BLOCKED_PACKAGES" ]; then
19 touch $ROOTFS/var/lib/tazpkg/blocked-packages.list
20 for i in $BLOCKED_PACKAGES
21 do
22 echo $i >> $ROOTFS/var/lib/tazpkg/blocked-packages.list
23 done
24 fi
27 # Set static IP config: IP=92.168.1.6/24. Gateway=192.168.1.1 DNS: 192.168.1.1
29 if [ ! -z $IP_STATIC ]; then
30 sed -i -e 's/DHCP=.*/DHCP=\"no\"/' \
31 -e 's/STATIC=.*/STATIC=\"yes\"/' \
32 -e 's/IP=.*/IP=\"192.168.1.6\"/' \
33 -e 's/GATEWAY=.*/GATEWAY=\"192.168.1.1\"/' \
34 -e 's/DNS_SERVER=.*/DNS_SERVER=\"192.168.1.1\"/' $ROOTFS/etc/network.conf
35 fi
37 # Change default hostname
38 if [ ! -z "$HOSTNAME" ]; then
39 echo "* Setting hostname to $HOSTNAME"
40 echo "$HOSTNAME" > $ROOTFS/etc/hostname
41 # Change hosts
42 sed -i -e "s/slitaz/$HOSTNAME/" $ROOTFS/etc/hosts
43 fi
45 # Start daemons at boot time
46 if [ ! -z "$AUTOSTART" ]; then
47 echo "* Enabling daemons at boot"
48 sed -i -e "s/RUN_DAEMONS=\"\(.*\)\"/RUN_DAEMONS=\"\1 $AUTOSTART\"/" \
49 $ROOTFS/etc/rcS.conf
50 fi
52 # Dont start daemons at boot time
53 if [ ! -z "$DONTSTART" ]; then
54 echo "* Disabling daemons at boot"
55 sed -i -e "s/$DONTSTART//" \
56 $ROOTFS/etc/rcS.conf
57 fi
59 ##
60 ## Custom config
61 ##
63 # Allow SSH root login from remote computer.
64 if [ $ALLOW_ROOT_LOGIN = "1" ]; then
65 echo "Allow root login using SSH"
66 sed -i 's!DROPBEAR_OPTIONS=.*!DROPBEAR_OPTIONS="-b /etc/dropbear/banner"!' \
67 $ROOTFS/etc/daemons.conf
68 fi
70 # Fix Apache config
71 sed -i '/#ServerName/ {
72 a\ServerName localhost
73 }' $ROOTFS/etc/apache/httpd.conf
75 #
76 sed -i 's/DirectoryMatch/Directory/' $ROOTFS/etc/apache/conf.d/phpmyadmin
78 # Remove extra files
79 rm -rf $ROOTFS/etc/apache/phpinfo
80 rm -rf $ROOTFS/usr/share/applications/lua.*
81 rm -rf $ROOTFS/usr/share/applications/sqlite.*
82 rm -rf $ROOTFS/usr/share/applications/gtkdialog.*
83 rm -rf $ROOTFS/usr/share/applications/php.*
84 rm -rf $ROOTFS/usr/share/applications/dialog.*
86 # Default config
87 sed -i 's/tazweb/midori/' $ROOTFS/etc/slitaz/applications.conf
89 #
90 #~ sed -i 's/transparent=1/transparent=0/' $ROOTFS/usr/share/lxpanel/profile/default/panels/panel
91 #~ sed -i 's/transparent=1/transparent=0/' $ROOTFS/etc/lxpanel/default/panels/panel
92 #~ sed -i 's/transparent=1/transparent=0/' $ROOTFS/etc/lxpanel/original/panels/panel
93 sed -i 's/tazweb/midori/' $ROOTFS/usr/share/lxpanel/profile/default/panels/panel
94 sed -i 's/tazweb/midori/' $ROOTFS/etc/lxpanel/default/panels/panel
95 sed -i 's/tazweb/midori/' $ROOTFS/etc/lxpanel/original/panels/panel
97 #~
98 # fix perms (don't know why)
99 chmod 755 $ROOTFS/etc/mysql.d/*
101 # Add shortcut on the Desktop
102 cp $ROOTFS/usr/share/applications/dolibarr.desktop $ROOTFS/etc/skel/Desktop
103 #cp $ROOTFS/usr/share/applications/phpmyadmin.desktop $ROOTFS/etc/skel/Desktop