mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-26 08:46:19 +00:00
91 lines
2.2 KiB
Bash
Executable file
91 lines
2.2 KiB
Bash
Executable file
#!/bin/bash
|
|
#
|
|
#
|
|
|
|
echo "Start Basic"
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server
|
|
apt-get install -y apache2 php5 libapache2-mod-php5 php5-mysql apache2-utils php5-gd php5-imagick rrdtool screen mcrypt php5-mcrypt
|
|
|
|
/usr/bin/mysql_install_db --user=mysql --skip-name-resolve || exit 2
|
|
|
|
# Start the MySQL daemon in the background.
|
|
/usr/sbin/mysqld &
|
|
mysql_pid=$!
|
|
|
|
until /usr/bin/mysqladmin ping >/dev/null 2>&1
|
|
do
|
|
echo -n "."
|
|
sleep 1
|
|
done
|
|
|
|
# Initialize password root (to empty)
|
|
/usr/bin/mysqladmin -u root password '' || exit 2
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y phpmyadmin
|
|
|
|
ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf || exit 2
|
|
a2enconf phpmyadmin.conf || exit 2
|
|
cp /etc/phpmyadmin/config.inc.php /etc/phpmyadmin/config.inc.php.ref || exit 2
|
|
awk '{if($0 ~ /AllowNoPassword/){$1="";}; print $0;}' /etc/phpmyadmin/config.inc.php.ref > /etc/phpmyadmin/config.inc.php || exit 2
|
|
|
|
|
|
# Stop MySQL
|
|
/usr/bin/mysqladmin shutdown
|
|
|
|
# Wait MySQL stop
|
|
wait $mysql_pid
|
|
|
|
# Initialize bashrc (for root)
|
|
cat << EOF > /root/.bashrc
|
|
# bashrc: executed by bash(1) for non-login shells.
|
|
|
|
# You may uncomment the following lines if you want 'ls' to be colorized:
|
|
export SHELL=/bin/bash
|
|
export LS_OPTIONS='--color=auto'
|
|
eval "\`dircolors\`"
|
|
alias ls='ls \$LS_OPTIONS'
|
|
alias ll='ls \$LS_OPTIONS -l'
|
|
alias l='ls \$LS_OPTIONS -lA'
|
|
|
|
# Some more alias to avoid making mistakes:
|
|
# alias rm='rm -i'
|
|
# alias cp='cp -i'
|
|
# alias mv='mv -i'
|
|
|
|
# Autocompletion
|
|
if [ -f /etc/bash_completion ]; then
|
|
. /etc/bash_completion
|
|
fi
|
|
EOF
|
|
|
|
|
|
cat << EOF > /home/compil/.bashrc
|
|
# bashrc: executed by bash(1) for non-login shells.
|
|
|
|
# You may uncomment the following lines if you want 'ls' to be colorized:
|
|
export SHELL=/bin/bash
|
|
export LS_OPTIONS='--color=auto'
|
|
eval "\`dircolors\`"
|
|
alias ls='ls \$LS_OPTIONS'
|
|
alias ll='ls \$LS_OPTIONS -l'
|
|
alias l='ls \$LS_OPTIONS -lA'
|
|
|
|
# Some more alias to avoid making mistakes:
|
|
# alias rm='rm -i'
|
|
# alias cp='cp -i'
|
|
# alias mv='mv -i'
|
|
|
|
# Autocompletion
|
|
if [ -f /etc/bash_completion ]; then
|
|
. /etc/bash_completion
|
|
fi
|
|
EOF
|
|
chown compil:compil /home/compil/.bashrc
|
|
|
|
cat << EOF > /etc/sudoers.d/compil
|
|
# User privilege specification
|
|
compil ALL=NOPASSWD: ALL
|
|
EOF
|
|
|
|
echo "End Basic"
|