diff --git a/scanservjs-update.sh b/scanservjs-update.sh new file mode 100755 index 0000000..152ed53 --- /dev/null +++ b/scanservjs-update.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +echo "Installing scanservjs directly from GitHub..." +curl -s https://raw.githubusercontent.com/sbs20/scanservjs/master/packages/server/installer.sh | bash -s -- -a + +exit 0 diff --git a/setup.sh b/setup.sh index 014c50e..be710a4 100644 --- a/setup.sh +++ b/setup.sh @@ -33,9 +33,11 @@ add_users() { usermod -a -G lp saned } -get_sync() { # TODO when new conf-sync will be available +get_sync() { echo "Getting and deploying sync configuration" sudo -H -u $user mkdir $sync_directory_path + sudo -H -u $user git clone https://gitea.kto.black/adminconf/printscan-server.git \ + $sync_directory_path/printscan-server sudo -H -u $user git clone https://gitea.kto.black/adminconf/rcs-general.git $sync_directory_path/rcs-general sudo -H -u $user $sync_directoyy_path/rcs-general/install.sh sudo -H -u $user git clone https://gitea.kto.black/adminconf/conf-sync.git $sync_directory_path/conf-sync @@ -62,19 +64,25 @@ ssh_pubkey() { } # based on https://github.com/sbs20/scanservjs/blob/master/docs/install.md +# install_scanservjs() { +# wget -O $run_directory_path/scanservjs.tar.gz $(curl -s \ +# https://api.github.com/repos/sbs20/scanservjs/releases/latest | grep browser_download_url | cut -d '"' -f 4) +# mkdir $run_directory_path/scanservjs +# tar -xf scanservjs.tar.gz -C $run_directory_path/scanservjs/ +# $run_directory_path/scanservjs/installer.sh -i +# rm $run_directory_path/scanservjs.tar.gz +# rm -r $run_directory_path/scanservjs +# } + install_scanservjs() { - wget -O $run_directory_path/scanservjs.tar.gz $(curl -s \ - https://api.github.com/repos/sbs20/scanservjs/releases/latest | grep browser_download_url | cut -d '"' -f 4) - mkdir $run_directory_path/scanservjs - tar -xf scanservjs.tar.gz -C $run_directory_path/scanservjs/ - sudo $run_directory_path/scanservjs/installer.sh -i - rm $run_directory_path/scanservjs.tar.gz - rm -r $run_directory_path/scanservjs + echo "Installing scanservjs directly from GitHub..." + curl -s https://raw.githubusercontent.com/sbs20/scanservjs/master/packages/server/installer.sh | bash -s -- -a } tls_cert() { echo "Generating TLS certificate" - openssl req -newkey rsa:4096 -x509 -sha256 -days 999 -nodes -out $tls_directory/$cert -keyout $tls_directory/$cert_key -subj "/C=/ST=/L=/O=/OU=/CN=" + openssl req -newkey rsa:4096 -x509 -sha256 -days 999 -nodes -out $tls_directory/$cert -keyout \ + $tls_directory/$cert_key -subj "/C=/ST=/L=/O=/OU=/CN=" chmod o+r $tls_directory/$cert_key }