first commit

This commit is contained in:
Bobban Rydh
2022-11-05 22:08:40 +01:00
commit 28e1434df2
15 changed files with 272 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#!/bin/bash
#¤making a date directory
echo making directory;
#time_stamp=$(date +%d-%m-%Y)
backup_user=$("amp")
time_stamp=$(date +%Y-%m-%d)
mkdir -p /home/"$(backup_user)"/backup1/"${time_stamp}"
#mkdir -p /home/amp/backup/"${time_stamp}"
#mkdir -p /home/amp/backup/"${time_stamp}"/Minecraft1.0
#mkdir -p /home/amp/backup/"${time_stamp}"/Minecraft2.0
#mkdir -p /home/amp/backup/"${time_stamp}"/Minecraft3.0
#mkdir -p /home/amp/backup/"${time_stamp}"/Minecraft4.0
#mkdir -p /home/amp/backup/"${time_stamp}"/Minecraftx1.0
echo Directory has been made!;
##############################################################
##############################################################
##### ####
##### © Tobias Rydh (toowwbb) ####
##### ####
##############################################################
##############################################################

8
Docker/clean-docker.sh Normal file
View File

@@ -0,0 +1,8 @@
#removing unused docker images
docker image prune -a
#remove unused docker networks
docker network prune
#remove unused docker volumes
docker volume prune

View File

@@ -0,0 +1,36 @@
# © Bobban 2021 - https://bobbantech.com
#
# This script will update the image version of the portainer-ce instance.
# Update documentation is followed from https://documentation.portainer.io/v2.0/upgrade/upddocker/
#
#Variable for what group the script is checking.
group="docker";
#Checking if the running user is member of the docker group
if id -nG "$USER" | grep -qw "$group"; then
#This part will run if the user is member of the group.
#Stopping the container
echo "Stopping Portainer container";
docker stop portainer
#Removing cointainer
echo "Removing existing container with the old image";
docker rm portainer
#Downloading latest image
echo "Download the new image from repository";
docker pull portainer/portainer-ce:latest
#Deploy
echo "Deploying a new countainer with the new image";
docker run -d -p 8000:8000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ee:latest
else
#This part will run if the user is not member of the group.
echo "
The user $user you are using is not member of the group $GROUP with is required to run this script.
Please run this command to solve this issue 'sudo usermod -aG docker $USER'. a restart of your session may be needed.
";
fi

View File

@@ -0,0 +1,36 @@
# © Bobban 2021 - https://bobbantech.com
#
# This script will update the image version of the portainer-ce instance.
# Update documentation is followed from https://documentation.portainer.io/v2.0/upgrade/upddocker/
#
#Variable for what group the script is checking.
group="docker";
#Checking if the running user is member of the docker group
if id -nG "$USER" | grep -qw "$group"; then
#This part will run if the user is member of the group.
#Stopping the container
echo "Stopping Portainer container";
docker stop portainer
#Removing cointainer
echo "Removing existing container with the old image";
docker rm portainer
#Downloading latest image
echo "Download the new image from repository";
docker pull portainer/portainer-ce:latest
#Deploy
echo "Deploying a new countainer with the new image";
docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
else
#This part will run if the user is not member of the group.
echo "
The user $user you are using is not member of the group $GROUP with is required to run this script.
Please run this command to solve this issue 'sudo usermod -aG docker $USER'. a restart of your session may be needed.
";
fi

View File

@@ -0,0 +1,4 @@
#!/bin/bash
# Cleaning unused docker images.
docker image prune -a -f

1
Linux/clean-server.sh Normal file
View File

@@ -0,0 +1 @@
#!/bin/bash

5
Linux/get-dotfiles.sh Executable file
View File

@@ -0,0 +1,5 @@
## Bobban Rydh
cp ~/.bashrc ~/dotfiles/.bashrc
cp ~/.config/starship.toml ~/dotfiles/.config/starship.toml
cp ~/.config/neofetch/config.conf ~/dotfiles/.config/neofetch/config.conf

View File

@@ -0,0 +1,56 @@
#!/bin/bash
echo "Starting backup sequence - Step 1/9";
#making a date directory
echo "Creating backup directory's - Step 2/9";
#time_stamp=$(date +%d-%m-%Y)
time_stamp=$(date +%Y-%m-%d)
mkdir -p /home/amp/backup/"${time_stamp}"
mkdir -p /home/amp/backup/"${time_stamp}"
mkdir -p /home/amp/backup/"${time_stamp}"/Minecraft1.0
mkdir -p /home/amp/backup/"${time_stamp}"/Minecraft2.0
mkdir -p /home/amp/backup/"${time_stamp}"/Minecraft3.0
mkdir -p /home/amp/backup/"${time_stamp}"/Minecraft4.0
mkdir -p /home/amp/backup/"${time_stamp}"/Minecraftx1.0
echo "Backup directory's created successful!";
#Copying minecraft 1.0 world
echo Copying minecraft 1.0 world - Step 3/9!; cp -r /home/amp/.ampdata/instances/Minecraft01/Minecraft/world "/home/amp/backup/${time_stamp}/Minecraft1.0/world"
echo Backup complete the backup is in "/home/amp/backup/${time_stamps}";
#Copying minecraft 2.0 world
echo Copying minecraft 2.0 world - Step 4/9!; cp -r /home/amp/.ampdata/instances/Minecraft02/Minecraft/world "/home/amp/backup/${time_stamp}/Minecraft2.0/world"
echo Backup complete the backup is in "/home/amp/backup/${time_stamps}";
#Copying minecraft world
echo Copying minecraft 3.0 world - Step 5/9!; cp -r /home/amp/.ampdata/instances/Minecraft03/Minecraft/world "/home/amp/backup/${time_stamp}/Minecraft3.0/world"
echo Backup complete the backup is in "/home/amp/backup/${time_stamps}";
#Copying minecraft world
echo Copying minecraft 4.0 world - Step 6/9!; cp -r /home/amp/.ampdata/instances/Minecraft04/Minecraft/world "/home/amp/backup/${time_stamp}/Minecraft4.0/world"
echo Backup complete the backup is in "/home/amp/backup/${time_stamps}";
#Copying minecraft world
echo Copying minecraft x1.0 world - Step 7/9!; cp -r /home/amp/.ampdata/instances/Minecraft05/Minecraft/world "/home/amp/backup/${time_stamp}/Minecraftx1.0/world"
echo Backup complete the backup is in "/home/amp/backup/${time_stamps}";
cd /home/amp/backup
echo "Creating tar-file - Step 8/9";
tar -cvf "${time_stamp}".tar "${time_stamp}"
echo "Removing backup directory's - Step 9/9";
rm -r "${time_stamp}"
echo "Backup sequence has been completed successful!";
##############################################################¤
##############################################################¤
##### ####¤
##### © Tobias Rydh (toowwbb) ####¤
##### Azunalabs.se ¤¤¤¤¤
##### ####¤
##############################################################¤
##############################################################¤

View File

@@ -0,0 +1,49 @@
#!/bin/bash
#¤making a date directory
echo making directory;
#time_stamp=$(date +%d-%m-%Y)
time_stamp=$(date +%Y-%m-%d)
mkdir -p /home/amp/backup/"${time_stamp}"
mkdir -p /home/amp/backup/"${time_stamp}"
mkdir -p /home/amp/backup/"${time_stamp}"/Minecraft1.0
mkdir -p /home/amp/backup/"${time_stamp}"/Minecraft2.0
mkdir -p /home/amp/backup/"${time_stamp}"/Minecraft3.0
mkdir -p /home/amp/backup/"${time_stamp}"/Minecraft4.0
mkdir -p /home/amp/backup/"${time_stamp}"/Minecraftx1.0
echo Directory has been made!;
#Copying minecraft world
echo Copying minecraft world!; cp -r /home/amp/.ampdata/instances/Minecraft01/Minecraft/ "/home/amp/backup/${time_stamp}/Minecraft1.0"
echo Backup complete the backup is in "/home/amp/backup/${time_stamps}";
#Copying minecraft world
echo Copying minecraft world!; cp -r /home/amp/.ampdata/instances/Minecraft02/Minecraft/ "/home/amp/backup/${time_stamp}/Minecraft2.0"
echo Backup complete the backup is in "/home/amp/backup/${time_stamps}";
#Copying minecraft world
echo Copying minecraft world!; cp -r /home/amp/.ampdata/instances/Minecraft03/Minecraft/ "/home/amp/backup/${time_stamp}/Minecraft3.0"
echo Backup complete the backup is in "/home/amp/backup/${time_stamps}";
#Copying minecraft world
echo Copying minecraft world!; cp -r /home/amp/.ampdata/instances/Minecraft04/Minecraft/ "/home/amp/backup/${time_stamp}/Minecraft4.0"
echo Backup complete the backup is in "/home/amp/backup/${time_stamps}";
#Copying minecraft world
echo Copying minecraft world!; cp -r /home/amp/.ampdata/instances/Minecraft05/Minecraft/ "/home/amp/backup/${time_stamp}/Minecraftx1.0"
echo Backup complete the backup is in "/home/amp/backup/${time_stamps}";
cd /home/amp/backup
tar -cvf "${time_stamp}".tar "${time_stamp}"
rm -r "${time_stamp}"
##############################################################
##############################################################
##### ####
##### © Tobias Rydh (toowwbb) ####
##### ####
##############################################################
##############################################################

View File

@@ -0,0 +1,19 @@
# Copyright 2020 - Tobias Rydh Azunalabs.se
echo "Coping master files...";
#Copy master version for whitelist.json
cp /home/amp/.ampdata/instances/Minecraft01/Minecraft/whitelist.json /home/amp/common-content/whitelist.json
cp /home/amp/.ampdata/instances/Minecraft01/Minecraft/ops.json /home/amp/common-content/ops.json
cp /home/amp/.ampdata/instances/Minecraft01/Minecraft/banned-players.json /home/amp/common-content/banned-players.json
cp /home/amp/.ampdata/instances/Minecraft01/Minecraft/banned-ips.json /home/amp/common-content/banned-ips.json
cp /home/amp/.ampdata/instances/Minecraft01/Minecraft/server-icon.png /home/amp/common-content/server-icon.png
echo "Distributing mater copy..."
#Distribute whitelist to all Minecraft servers
#cp /home/amp/common-content/whitelist.json /home/amp/.ampdata/instances/Minecraft02/Minecraft/whitelist.json
#cp /home/amp/common-content/whitelist.json /home/amp/.ampdata/instances/Minecraft03/Minecraft/whitelist.json
cp /home/amp/common-content/whitelist.json /home/amp/.ampdata/instances/Minecraft04/Minecraft/whitelist.json
cp /home/amp/common-content/ops.json /home/amp/.ampdata/instances/Minecraft04/Minecraft/ops.json
echo "My job here is done!"

View File

@@ -0,0 +1,13 @@
# Copyright 2019 - Tobias Rydh Azunalabs.se
echo "Coping master file...";
#Copy master version for whitelist.json
cp /home/amp/scripts/ /home/amp/backup/scripts/
echo "Distributing mater copy..."
#Distribute whitelist to all Minecraft servers
#cp /home/amp/common-content/whitelist.json /home/amp/.ampdata/instances/Minecraft02/Minecraft/whitelist.json
#cp /home/amp/common-content/whitelist.json /home/amp/.ampdata/instances/Minecraft03/Minecraft/whitelist.json
#cp /home/amp/common-content/whitelist.json /home/amp/.ampdata/instances/Minecraft04/Minecraft/whitelist.json
echo "My job here is done!"

View File

@@ -0,0 +1,13 @@
# Copyright 2019 - Tobias Rydh Azunalabs.se
echo "Coping master file...";
#Copy master version for whitelist.json
cp /home/amp/.ampdata/instances/Minecraft01/Minecraft/ops.json /home/amp/common-content/ops.json
echo "Distributing mater copy..."
#Distribute whitelist to all Minecraft servers
#cp /home/amp/common-content/whitelist.json /home/amp/.ampdata/instances/Minecraft02/Minecraft/whitelist.json
#cp /home/amp/common-content/whitelist.json /home/amp/.ampdata/instances/Minecraft03/Minecraft/whitelist.json
cp /home/amp/common-content/whitelist.json /home/amp/.ampdata/instances/Minecraft04/Minecraft/whitelist.json
echo "My job here is done!"

1
README.md Normal file
View File

@@ -0,0 +1 @@
# Scripts

3
setup.sh Normal file
View File

@@ -0,0 +1,3 @@
#\bin\bash
# Copyright 2021 Tobias Bobban - bobbantech.com

1
test.sh Normal file
View File

@@ -0,0 +1 @@
test