Add post-install script
Signed-off-by: Severin Kaderli <severin.kaderli@gmail.com>
This commit is contained in:
parent
cd781c174e
commit
006fddf028
5 changed files with 136 additions and 100 deletions
43
utils.sh
Normal file
43
utils.sh
Normal file
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Author: Severin Kaderli <severin.kaderli@gmail.com>
|
||||
|
||||
#######################################
|
||||
# Directory variables
|
||||
#######################################
|
||||
DIR="$( cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"
|
||||
SYSTEM_DIR="$DIR/system"
|
||||
PACKAGES_DIR="$DIR/packages"
|
||||
|
||||
#######################################
|
||||
# Bash color code variables
|
||||
#######################################
|
||||
RESET='\033[0m'
|
||||
GREEN='\033[32m'
|
||||
RED='\033[31m'
|
||||
BLUE='\033[34m'
|
||||
YELLOW='\033[33m'
|
||||
|
||||
#######################################
|
||||
# Helper functions
|
||||
#######################################
|
||||
# Function to display fancy headers
|
||||
function print_header() {
|
||||
echo -e "$GREEN########################################"
|
||||
echo -e "# $1"
|
||||
echo -e "########################################$RESET"
|
||||
}
|
||||
|
||||
# Function to set owner and permission of a file
|
||||
function set_permission() {
|
||||
echo -e "- Changing permission of $3 to $1"
|
||||
sudo chown -R "$1" "$3"
|
||||
echo -e "- Changing permission of $3 to $2"
|
||||
sudo chmod -R "$2" "$3"
|
||||
}
|
||||
|
||||
# Function to enable a service
|
||||
function enable_service() {
|
||||
echo -e "- Enabling service $1"
|
||||
sudo systemctl enable "$1"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue