Skip to content

Commit

Permalink
rename init tot sysinit
Browse files Browse the repository at this point in the history
  • Loading branch information
pmendelski committed Sep 30, 2023
1 parent 3f30d2e commit c1a2059
Show file tree
Hide file tree
Showing 39 changed files with 13 additions and 10 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ zsh/.zsh/deps
zsh/.zsh/ohmyzsh
tmux/.tmux/tmp
tmux/.tmux/deps
_init/ubuntu/conky/tmp
!.gitkeep
.DS_Store
.netrwhist
File renamed without changes.
8 changes: 6 additions & 2 deletions _init/macos/config.sh → _sysinit/macos/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ osascript -e 'tell application "System Preferences" to quit'
sudo -v

# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
while true; do
sudo -n true
sleep 60
kill -0 "$$" || exit
done 2>/dev/null &

###############################################################################
# General UI/UX #
Expand Down Expand Up @@ -270,7 +274,7 @@ for app in \
"Safari" \
"SystemUIServer" \
"iCal"; do
killall "${app}" &> /dev/null
killall "${app}" &>/dev/null
done

###############################################################################
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion _init/macos/packages.sh → _sysinit/macos/packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ echo " - Finder > Right Click Toolbar > Customize > ..."
echo ""
echo "iTerm2"
echo "- Read settings from file: Preferences > General > Preferences"
echo " Read from file .dotfiles/_init/macos/iterm2"
echo " Read from file .dotfiles/_sysinit/macos/iterm2"
echo ""
echo "Other"
echo "- Fix keyboard shortcuts"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ checkBashScripts() {
-not -path "*/plugins/*" \
-not -path "*/tmp/*" \
-not -path "*/.luarocks/*" \
-not -path "./_init/*/templates/*")"
-not -path "./_sysinit/*/templates/*")"
echo -e "\n>>> Running ShellCheck for bash"
shellcheck $files
echo -e "<<< ShellCheck passed\n"
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ Initialization script installs packages and applies OS configuration.

Run:
```
./init.sh SYSTEM_NAME
./sysinit.sh SYSTEM_NAME
```
SYSTEM_NAME can be one of: ubuntu, ubuntu-server, macos. See [_init](./_init) for details.
SYSTEM_NAME can be one of: ubuntu, ubuntu-server, macos. See [_sysinit](./_sysinit) for details.
6 changes: 3 additions & 3 deletions init.sh → sysinit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [ "$(bash --version | grep -o -E '[0-9]+' | head -n 1)" -lt 4 ]; then
fi

# Constant values
declare -r INIT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && echo "$PWD")/_init"
declare -r INIT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && echo "$PWD")/_sysinit"

# Make sure we're in the init directory
cd "$INIT_DIR"
Expand All @@ -17,12 +17,12 @@ init() {
local system="$1"
if [ -z "$system" ] || [ ! -d "$INIT_DIR/$system" ]; then
echo "Expected system as a parameter."
echo " Example: init.sh ubuntu-server"
echo " Example: sysinit.sh ubuntu-server"
echo " Available system inits: $(ls "$INIT_DIR" | tr '\n' ' ')"
exit 1
fi
cd "$INIT_DIR/$system"
echo "Initializing $system"
echo "Initializing system: $system"
bash "./init.sh" &&
echo -e "\n\nSUCCESS: System initalized successfuly" ||
echo -e "\n\nFAILURE: Initalizion failure"
Expand Down

0 comments on commit c1a2059

Please sign in to comment.