41 lines
1.2 KiB
Bash
41 lines
1.2 KiB
Bash
#!/bin/bash
|
|
#install requirements
|
|
sudo apt update -y
|
|
sudo apt upgrade -y
|
|
sudo apt install lftp fbi ffmpeg cifs-utils samba apache2 php libapache2-mod-php vlc imagemagick -y
|
|
|
|
current_date=$(date +%Y_%m_%d_%H_%M_%S)
|
|
|
|
#Backup modified files
|
|
cp /home/$USER/.bashrc /home/$USER/WHIT/install/backup/.bashrc.$current_date
|
|
sudo cp /etc/samba/smb.conf /home/$USER/WHIT/install/backup/smb.conf.$current_date
|
|
sudo cat /home/$USER/WHIT/install/samba.conf |sudo tee -a /etc/samba/smb.conf
|
|
sudo cp /home/$USER/WHIT/install/html /var/www/html/whit -r
|
|
|
|
sudo sed -i s/'$USER'/"$USER"/g /etc/samba/smb.conf
|
|
|
|
#make folder
|
|
mkdir /home/$USER/WHIT/tv
|
|
mkdir /home/$USER/WHIT/working
|
|
sudo mkdir /mnt/whit
|
|
|
|
|
|
#Make Scripts EXECUTABLE
|
|
chmod +x /home/$USER/WHIT/config/autostart.sh
|
|
chmod +x /home/$USER/WHIT/config/wifi.sh
|
|
|
|
#config after boot
|
|
sudo touch /boot/1st_boot
|
|
|
|
#Midnight reboot
|
|
echo " * * * root /sbin/reboot" | sudo tee /etc/cron.d/020_whit
|
|
|
|
#Activate shortcuts in .bashrc
|
|
sed -i "s/#alias ll='ls -l'/alias ll='ls -l'/g" /home/$USER/.bashrc
|
|
sed -i "s/#alias ll='ls -A'/alias la='ls -A'/g" /home/$USER/.bashrc
|
|
sed -i "s/#alias l='ls -CF'/alias ll='ls -CFl'/g" /home/$USER/.bashrc
|
|
|
|
|
|
#add configure and run to .bashrc
|
|
cat /home/$USER/WHIT/install/bashrcinfo >> /home/$USER/.bashrc
|