main,proxy
This commit is contained in:
parent
fbfb4c27e6
commit
8b39df8ed0
2 changed files with 27 additions and 27 deletions
42
bash/main.sh
42
bash/main.sh
|
@ -5,31 +5,31 @@ MAIN_BASH_FILE="$(realpath "${BASH_SOURCE[0]}")"
|
||||||
MAIN_BASH_ROOT="$(dirname "${MAIN_BASH_FILE}")"
|
MAIN_BASH_ROOT="$(dirname "${MAIN_BASH_FILE}")"
|
||||||
|
|
||||||
main_link_bashrc() {
|
main_link_bashrc() {
|
||||||
local file="/etc/bash.bashrc"
|
local file="/etc/bash.bashrc"
|
||||||
rm --force "${file}"
|
rm --force "${file}"
|
||||||
ln --symbolic "${MAIN_BASH_FILE}" "${file}"
|
ln --symbolic "${MAIN_BASH_FILE}" "${file}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# import modules
|
# import modules
|
||||||
main_import_modules() {
|
main_import_modules() {
|
||||||
local file="${1}"
|
local file="${1}"
|
||||||
if [ -f "${file}" ] ; then
|
if [ -f "${file}" ] ; then
|
||||||
local path="$(realpath "${file}")"
|
local path="$(realpath "${file}")"
|
||||||
local root="$(dirname "${path}")"
|
local root="$(dirname "${path}")"
|
||||||
local IFS=$'\n'
|
local IFS=$'\n'
|
||||||
local modules=($(find "${root}" -type "f" -name "*.sh" | sort))
|
local modules=($(find "${root}" -type "f" -name "*.sh" | sort))
|
||||||
local module
|
local module
|
||||||
for module in "${modules[@]}" ; do
|
for module in "${modules[@]}" ; do
|
||||||
if [ "${module}" != "${path}" ] ; then
|
if [ "${module}" != "${path}" ] ; then
|
||||||
. "${module}"
|
. "${module}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
log_trace "${modules[@]}"
|
log_trace "${modules[@]}"
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
log_fatal "No file: ${file}"
|
log_fatal "No file: ${file}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# import modules
|
# import modules
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
socks() {
|
socks() {
|
||||||
local value
|
local value
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
"on") value="manual" ;;
|
"on") value="manual" ;;
|
||||||
*) value="none" ;;
|
*) value="none" ;;
|
||||||
esac
|
esac
|
||||||
gsettings set "org.gnome.system.proxy" "mode" "${value}"
|
gsettings set "org.gnome.system.proxy" "mode" "${value}"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue