forked from ChrisTitusTech/linutil
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
74 changed files
with
754 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
external-sources=true | ||
source=core/tabs/common-script.sh | ||
source=core/tabs/common-script.sh | ||
source=core/tabs/common-service-script.sh |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use serde::Deserialize; | ||
use std::path::Path; | ||
use std::process; | ||
|
||
#[derive(Deserialize)] | ||
pub struct Config { | ||
pub auto_execute: Vec<String>, | ||
} | ||
|
||
impl Config { | ||
pub fn from_file(path: &Path) -> Self { | ||
let content = match std::fs::read_to_string(path) { | ||
Ok(content) => content, | ||
Err(e) => { | ||
eprintln!("Failed to read config file {}: {}", path.display(), e); | ||
process::exit(1); | ||
} | ||
}; | ||
|
||
match toml::from_str(&content) { | ||
Ok(config) => config, | ||
Err(e) => { | ||
eprintln!("Failed to parse config file: {}", e); | ||
process::exit(1); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh -e | ||
|
||
. ../../common-script.sh | ||
|
||
installTorBrowser() { | ||
if ! command_exists torbrowser-launcher; then | ||
printf "%b\n" "${YELLOW}Installing Tor Browser...${RC}" | ||
case "$PACKAGER" in | ||
apt-get|nala) | ||
"$ESCALATION_TOOL" "$PACKAGER" install -y torbrowser-launcher | ||
;; | ||
zypper) | ||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install torbrowser-launcher | ||
;; | ||
pacman) | ||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm torbrowser-launcher | ||
;; | ||
dnf) | ||
"$ESCALATION_TOOL" "$PACKAGER" install -y torbrowser-launcher | ||
;; | ||
*) | ||
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}" | ||
exit 1 | ||
;; | ||
esac | ||
else | ||
printf "%b\n" "${GREEN}Tor Browser is already installed.${RC}" | ||
fi | ||
} | ||
|
||
checkEnv | ||
checkEscalationTool | ||
installTorBrowser | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.