Skip to content
Snippets Groups Projects
Commit 329f2a2c authored by Recolic's avatar Recolic :house_with_garden:
Browse files

test and bugfix

parent 2f89ddc3
No related branches found
No related tags found
1 merge request!2test and bugfix
...@@ -21,21 +21,22 @@ XMODIFIERS=@im=fcitx5' > /etc/environment ...@@ -21,21 +21,22 @@ XMODIFIERS=@im=fcitx5' > /etc/environment
lc_init () { lc_init () {
# my favorite pkgs # my favorite pkgs
pacman -Sy --noconfirm fish dhcpcd vim sudo openssh pacman -Syu --noconfirm
pacman -Sy --noconfirm --asdeps openssl pacman -S --noconfirm fish dhcpcd vim sudo openssh
pacman -S --noconfirm --asdeps openssl
# add primary user # add primary user. If you want to do this, at least give read access to linuxconf dir.
useradd --create-home --shell /usr/bin/fish rtest useradd --create-home --shell /usr/bin/fish rtest
echo 'rtest ALL=(ALL) NOPASSWD: ALL' | EDITOR='tee -a' visudo echo 'rtest ALL=(ALL) NOPASSWD: ALL' | EDITOR='tee -a' visudo
usermod --password $(echo testpass | openssl passwd -1 -stdin) rtest usermod --password $(echo testpass | openssl passwd -1 -stdin) rtest
if ! sudo -u rtest realpath masterconf.sh; then if ! sudo -u rtest realpath masterconf.sh; then
echo "ERROR: rtest do not have access to current dir... fix permission and manually register with 'sudo -u rtest'." echo "ERROR: rtest do not have read access to current dir... fix permission and manually register with 'sudo -u rtest'."
else else
sudo -u rtest linuxconf register masterconf.sh sudo -u rtest linuxconf register masterconf.sh
fi fi
# more customization... # more one-time customization
grep kernel.sysrq=1 /etc/sysctl.d/99-sysctl.conf || echo 'kernel.sysrq=1' >> /etc/sysctl.d/99-sysctl.conf grep kernel.sysrq=1 /etc/sysctl.d/99-sysctl.conf || echo 'kernel.sysrq=1' >> /etc/sysctl.d/99-sysctl.conf
grep recolic-aur /etc/pacman.conf || echo '[recolic-aur] grep recolic-aur /etc/pacman.conf || echo '[recolic-aur]
......
...@@ -45,7 +45,7 @@ user_pref("browser.tabs.hoverPreview.enabled", false);' ...@@ -45,7 +45,7 @@ user_pref("browser.tabs.hoverPreview.enabled", false);'
[[ -d "$dir" ]] && echo "$firefox_config" > "$dir/user.js" [[ -d "$dir" ]] && echo "$firefox_config" > "$dir/user.js"
done done
[[ -f /usr/bin/az ]] && az config set core.login_experience_v2=off [[ -f /usr/bin/az ]] && az config set core.login_experience_v2=off || true
} }
lc_login () { lc_login () {
......
#!/bin/bash #!/bin/bash
if [ ! -f /usr/bin/linuxconf ]; then if [ ! -f /usr/bin/linuxconf ]; then
curl "https://git.recolic.net/root/linuxconf/-/raw/master/linuxconf?ref_type=heads" -o /usr/bin/linuxconf || # curl "https://git.recolic.net/root/linuxconf/-/raw/master/linuxconf?ref_type=heads" -o /usr/bin/linuxconf ||
curl "https://recolic.cc/tmp/linuxconf" -o /usr/bin/linuxconf ||
! echo "Unable to download linuxconf executable." || exit 1 ! echo "Unable to download linuxconf executable." || exit 1
chmod +x /usr/bin/linuxconf chmod +x /usr/bin/linuxconf
fi fi
......
...@@ -13,10 +13,10 @@ function die () { ...@@ -13,10 +13,10 @@ function die () {
} }
function lc_assert_user_is () { function lc_assert_user_is () {
[[ "$(whoami)" = "$1" ]] || exit 2 [[ "$(whoami)" = "$1" ]] || exit 0
} }
function lc_assert_user_is_not () { function lc_assert_user_is_not () {
[[ "$(whoami)" != "$1" ]] || exit 2 [[ "$(whoami)" != "$1" ]] || exit 0
} }
function lc_include () { function lc_include () {
...@@ -32,7 +32,7 @@ function lc_include () { ...@@ -32,7 +32,7 @@ function lc_include () {
eval "$LCI_SUBSHELL_OP" eval "$LCI_SUBSHELL_OP"
) )
echo2 "$script -- $LCI_SUBSHELL_OP completed with status $?" echo2 "$script -- $LCI_SUBSHELL_OP completed with status $?"
# TODO: should I abort on failure? But for nested lc_include, I cannot know if it failed. # TODO: should I abort on failure? It will stop running other include files. Don't do it now.
done done
return 0 return 0
...@@ -223,7 +223,7 @@ function lci_install_login_hook () { ...@@ -223,7 +223,7 @@ function lci_install_login_hook () {
fi fi
} }
lci_version=0.1.1 lci_version=0.2.0
subcommand="$1" subcommand="$1"
if [[ "$subcommand" != register ]] && [[ "$subcommand" != "" ]]; then if [[ "$subcommand" != register ]] && [[ "$subcommand" != "" ]]; then
[[ ! -f /etc/linuxconf.conf ]] && die "Please run '$0 register <path/to/masterconf.sh>' at least once" [[ ! -f /etc/linuxconf.conf ]] && die "Please run '$0 register <path/to/masterconf.sh>' at least once"
......
test.sh 0 → 100644
set -e
tar -cvzf /tmp/test.tgz examples
netpush /tmp/test.tgz
echo "
TODO:
rm /mnt/fsdisk/svm/vm/archtest/ -r
pgkill archtest
ssh -p 30476 r@hms.r
sudo su
cd /
curl https://recolic.cc/tmp/test.tgz | tar xvzf -
"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment