attempt to fix user creation

This commit is contained in:
Ward from fusion-voyager-3 2024-02-18 15:53:29 +03:00
parent 6c6160c9d3
commit b515aa81ac
3 changed files with 7 additions and 6 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "pika-first-setup-gtk4" name = "pika-first-setup-gtk4"
version = "0.1.0" version = "1.0.1"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
pika-first-setup (1.0.0-100pika1) pikauwu; urgency=low pika-first-setup (1.0.1-100pika1) pikauwu; urgency=low
* First release * First release

View File

@ -21,12 +21,12 @@ USERNAME="$0"
PASSWORD="$1" PASSWORD="$1"
FULLNAME="$2" FULLNAME="$2"
adduser --quiet --disabled-password --shell /bin/bash --gecos "${FULLNAME}" "${USERNAME}" adduser --quiet --disabled-password --shell /bin/bash --gecos "${FULLNAME}" "${USERNAME}"
echo "${USERNAME}":"${PASSWORD}" | /usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh chpasswd echo "${USERNAME}":"${PASSWORD}" | chpasswd
usermod -a -G /usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh "${USERNAME}" usermod -a -G sudo "${USERNAME}"
mkdir -p /home/"${USERNAME}" mkdir -p /home/"${USERNAME}"
cp -rvf /etc/skel/.* /home/"${USERNAME}"/ || true cp -rvf /etc/skel/.* /home/"${USERNAME}"/ || true
chown -R "${USERNAME}":"${USERNAME}" /home/"${USERNAME}" chown -R "${USERNAME}":"${USERNAME}" /home/"${USERNAME}"
usermod -a -G adm,cdrom,/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh,render,dip,video,plugdev,input,render,lpadmin "${USERNAME}" usermod -a -G adm,cdrom,sudo,render,dip,video,plugdev,input,render,lpadmin "${USERNAME}"
rm -rf /etc/sddm.conf.d/zautologin.conf || true rm -rf /etc/sddm.conf.d/zautologin.conf || true
"###; "###;
@ -281,7 +281,8 @@ pub fn user_carousel(first_setup_carousel: &adw::Carousel) {
})); }));
user_next_button.connect_clicked(clone!(@weak first_setup_carousel, @weak user_info_username, @weak user_info_password, @weak user_info_full_name => move |_| { user_next_button.connect_clicked(clone!(@weak first_setup_carousel, @weak user_info_username, @weak user_info_password, @weak user_info_full_name => move |_| {
let _ = cmd!("/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh", "bash", "-c", USER_CREATE_PROG, &user_info_username.text(), &user_info_password.text(), &user_info_full_name.text()).read(); let result cmd!("/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh", "bash", "-c", USER_CREATE_PROG, &user_info_username.text(), &user_info_password.text(), &user_info_full_name.text()).read();
assert!(result.is_ok());
first_setup_carousel.scroll_to(&first_setup_carousel.nth_page(3), true); first_setup_carousel.scroll_to(&first_setup_carousel.nth_page(3), true);
})); }));
} }