@@ -15,14 +15,14 @@ update_os
1515
1616msg_info " Installing Dependencies"
1717$STD apt-get install -y \
18- curl \
19- composer \
20- git \
21- sudo \
22- mc \
23- nginx \
24- php8.2-{bcmath,common,ctype,curl,fileinfo,fpm,gd,iconv,intl,mbstring,mysql,soap,xml,xsl,zip,cli} \
25- mariadb-server
18+ curl \
19+ composer \
20+ git \
21+ sudo \
22+ mc \
23+ nginx \
24+ php8.2-{bcmath,common,ctype,curl,fileinfo,fpm,gd,iconv,intl,mbstring,mysql,soap,xml,xsl,zip,cli} \
25+ mariadb-server
2626msg_ok " Installed Dependencies"
2727
2828msg_info " Setting up database"
@@ -37,12 +37,12 @@ mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVI
3737 echo " SnipeIT Database User: $DB_USER "
3838 echo " SnipeIT Database Password: $DB_PASS "
3939 echo " SnipeIT Database Name: $DB_NAME "
40- } >> ~ /snipeit.creds
40+ } >> ~/snipeit.creds
4141msg_ok " Set up database"
4242
4343msg_info " Installing Snipe-IT"
4444temp_file=$( mktemp)
45- RELEASE=$( curl -s https://api.github.com/repos/snipe/snipe-it/releases/latest | grep ' "tag_name"' | sed -E ' s/.*"tag_name": "v([^"]+).*/\1/ ' )
45+ RELEASE=$( curl -s https://api.github.com/repos/snipe/snipe-it/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) } ' )
4646wget -q " https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE} .tar.gz" -O $temp_file
4747tar zxf $temp_file
4848mv snipe-it-${RELEASE} /opt/snipe-it
@@ -51,15 +51,15 @@ cp .env.example .env
5151IPADDRESS=$( hostname -I | awk ' {print $1}' )
5252
5353sed -i -e " s|^APP_URL=.*|APP_URL=http://$IPADDRESS |" \
54- -e " s|^DB_DATABASE=.*|DB_DATABASE=$DB_NAME |" \
55- -e " s|^DB_USERNAME=.*|DB_USERNAME=$DB_USER |" \
56- -e " s|^DB_PASSWORD=.*|DB_PASSWORD=$DB_PASS |" .env
54+ -e " s|^DB_DATABASE=.*|DB_DATABASE=$DB_NAME |" \
55+ -e " s|^DB_USERNAME=.*|DB_USERNAME=$DB_USER |" \
56+ -e " s|^DB_PASSWORD=.*|DB_PASSWORD=$DB_PASS |" .env
5757
5858chown -R www-data: /opt/snipe-it
5959chmod -R 755 /opt/snipe-it
6060export COMPOSER_ALLOW_SUPERUSER=1
6161$STD composer update --no-plugins --no-scripts
62- $STD composer install --no-dev --prefer-source --no-plugins --no-scripts
62+ $STD composer install --no-dev
6363$STD php artisan key:generate --force
6464echo " ${RELEASE} " > " /opt/${APPLICATION} _version.txt"
6565msg_ok " Installed SnipeIT"
@@ -69,13 +69,13 @@ cat <<EOF >/etc/nginx/conf.d/snipeit.conf
6969server {
7070 listen 80;
7171 root /opt/snipe-it/public;
72- server_name $IPADDRESS ;
72+ server_name $IPADDRESS ;
7373 index index.php;
74-
74+
7575 location / {
7676 try_files \$ uri \$ uri/ /index.php?\$ query_string;
7777 }
78-
78+
7979 location ~ \.php\$ {
8080 include fastcgi.conf;
8181 include snippets/fastcgi-php.conf;
9090systemctl reload nginx
9191msg_ok " Configured Service"
9292
93-
9493motd_ssh
9594customize
9695
0 commit comments