mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 14:26:07 +08:00
16 lines
247 B
Bash
Executable File
16 lines
247 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
store_env_vars() {
|
|
initial_vars=($(env | cut -d= -f1))
|
|
}
|
|
|
|
restore_env_vars() {
|
|
for key in $(env | cut -d= -f1); do
|
|
if ! [[ " ${initial_vars[@]} " =~ " $key " ]]; then
|
|
unset "$key"
|
|
fi
|
|
done
|
|
}
|
|
|
|
store_env_vars
|