|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +clear |
| 4 | +figlet "WARNING" |
| 5 | +echo "This script is meant to prepare system for public build, DO NOT RUN IT, if you don't know what you're doing!" |
| 6 | +# Simple script to run prior to compiling a public .iso for new version |
| 7 | +sleep 3 |
| 8 | + |
| 9 | +clear |
| 10 | +echo "Starting process..." |
| 11 | + |
| 12 | +# to be sure |
| 13 | +cd |
| 14 | + |
| 15 | +# Make sure skel perms works |
| 16 | +sudo chmod -R 755 /etc/skel/.config |
| 17 | + |
| 18 | +# vbox log trash |
| 19 | +rm .vbox* |
| 20 | + |
| 21 | +# .conky |
| 22 | +sudo rm -rf /etc/skel/.conky |
| 23 | +sudo cp -r ~/.conky /etc/skel/.conky |
| 24 | + |
| 25 | +# .config dir |
| 26 | +sudo rm -rf /etc/skel/.config |
| 27 | +sudo cp -r ~/.config /etc/skel/.config |
| 28 | +# Get rid of session files |
| 29 | +sudo rm -r /etc/skel/.config/session |
| 30 | +#sudo rm -r /etc/skel/.config/chromium |
| 31 | + |
| 32 | +# Szmelc dir |
| 33 | +sudo rm -fr /etc/skel/szmelc |
| 34 | +sudo cp -r ~/szmelc /etc/skel/szmelc |
| 35 | +# bashrc |
| 36 | +# sudo rm -fr /etc/skel/.bashrc |
| 37 | +# sudo cp ~/.bashrc /etc/skel/.bashrc |
| 38 | +sudo rm /etc/skel/.zshrc |
| 39 | +sudo cp ~/.zshrc /etc/skel/.zshrc |
| 40 | +sudo rm /etc/skel/.p10k.zsh |
| 41 | +sudo cp ~/.p10k.zsh /etc/skel/.p10k.zsh |
| 42 | +sudo rm /etc/skel/.zcompdump |
| 43 | +sudo cp ~/.zcompdump /etc/skel/.zcompdump |
| 44 | + |
| 45 | +sudo rm -fr /etc/skel/.local |
| 46 | +sudo cp -r /home/szmelc/.local /etc/skel/.local |
| 47 | + |
| 48 | +# REMOVE USER DATA FROM BROWSER |
| 49 | +sudo rm -f /etc/skel/.config/chromium/Default/{Login\ Data*,Cookies,History,History-journal,Web\ Data*,Top\ Sites*,Visited\ Links,Current\ Session,Current\ Tabs,Last\ Session,Last\ Tabs} |
| 50 | + |
| 51 | +# sudo rm -f $HOME/.config/chromium/Default/{Login\ Data*,Cookies,History,History-journal,Web\ Data*,Top\ Sites*,Visited\ Links,Current\ Session,Current\ Tabs,Last\ Session,Last\ Tabs} |
| 52 | + |
| 53 | +sleep 3 |
| 54 | + |
| 55 | +# Prompt the user for the Build ID string |
| 56 | +read -p "Build ID: " build |
| 57 | +echo "$build" | sudo tee /etc/.entropy-build > /dev/null |
| 58 | + |
| 59 | +# Prompt the user for the new version number |
| 60 | +read -p "Enter the new version number (e.g., 9): " new_version |
| 61 | + |
| 62 | +# Define the files to update |
| 63 | +FILES=("/etc/initrd_release" "/etc/lsb-release") |
| 64 | + |
| 65 | +# Loop through each file and replace vX with the new version |
| 66 | +for FILE in "${FILES[@]}"; do |
| 67 | + if [ -f "$FILE" ]; then |
| 68 | + # Use sed to replace v8 or any vX with the specified version |
| 69 | + sudo sed -i "s/v[0-9]\+/v$new_version/g" "$FILE" |
| 70 | + echo "Updated version in $FILE to v$new_version" |
| 71 | + else |
| 72 | + echo "$FILE not found." |
| 73 | + fi |
| 74 | +done |
| 75 | + |
| 76 | +echo "Complete" |
| 77 | + |
0 commit comments